摘要:
1、取出/etc/passwd中的第1行的第1列,第3列和最后一列 awk -F: 'NRՎҧ1{print $1,\(3,\)NF}' /etc/passwd 2、取出/etc/passwd的第1行 awk 'NR==1' /etc/passwd 3、取出第2行到第5行的内容 awk 'NR>=2 阅读全文
posted @ 2024-07-12 11:30
还得多长时间·
阅读(62)
评论(0)
推荐(0)
摘要:
增删改查 1、取出/etc/passwd文件的第3行 sed -n '3p' /etc/passwd 2、取出/etc/passwd文件的第2行到第5行 sed -n '2,5p' /etc/passwd 3、过滤出/etc/passwd中包含root的行 sed -n '/root/p' /etc 阅读全文
posted @ 2024-07-12 10:54
还得多长时间·
阅读(25)
评论(0)
推荐(0)
摘要:
1、找出/etc/下以.conf结尾的文件 find /etc/ -type f -name '*.conf' 2、在/etc/和/tmp/目录下找出大于100kb的文件 find /etc/ /tmp/ -type f -size +100k 3、找出/etc/目录下以.conf结尾的,7天之前的 阅读全文
posted @ 2024-07-12 10:16
还得多长时间·
阅读(24)
评论(0)
推荐(0)

浙公网安备 33010602011771号