2.6 文本文件编辑命令
# cat -n initial-setup-ks.cfg# more initial-setup-ks.cfg # head -n 20 initial-setup-ks.cfg# tail -n 20 initial-setup-ks.cfg# tail -f /var/log/messages参数
作用
最后更新于
# cat -n initial-setup-ks.cfg# more initial-setup-ks.cfg # head -n 20 initial-setup-ks.cfg# tail -n 20 initial-setup-ks.cfg# tail -f /var/log/messages最后更新于
# cat anaconda-ks.cfg | tr a-z A-Z# wc -l /etc/passwd
40 /etc/passwd# stat anaconda-ks.cfg # grep /sbin/nologin /etc/passwd# cut -d: -f1 /etc/passwd# diff --brief diff_A.txt diff_B.txt
Files diff_A.txt and diff_B.txt differ# diff -c diff_A.txt diff_B.txt
*** diff_A.txt 2021-10-18 04:17:50.576480107 +0800
--- diff_B.txt 2021-10-18 04:19:48.012486161 +0800
***************
*** 1,6 ****
! Welcome to Linuxprobe.com
Red Hat certified
! Free Linux lessons
Professional guidance
Linux Course
-
--- 1,7 ----
! Welcome tooo certified
!
Red Hat certified
! Free Linux LeSSons
! ////////......////////
Professional guidance
Linux Course# uniq uniq.txt