tail命令用於輸入文件中的尾部內容。tail命令默認在屏幕上顯示指定文件的末尾10行。
tail file (顯示文件file的最後10行)
tail +20 file (顯示文件file的內容,從第20行至文件末尾)
tail -c 10 file (顯示文件file的最後10個字符)
選項:
-c <數字> 顯示文件的最後#個字符
實例:
顯示文件的最後10行 [root@localhost tmp]# tail functions "x$1" = xcondrestart ] ; then systemctl_redirect $0 $1 exit $? fi fi strstr "$(cat /proc/cmdline)" "rc.debug" && set -x return 0
[root@localhost tmp]# tail -c 20 functions
&& set -x
return 0