随笔分类 - ④linux高级命令三剑客
摘要:#####根据内容过滤文本信息 #####grep [root@rstx-201 ~]# grep root /etc/passwd root:x:0:0:root:/root:/bin/bash operator:x:11:0:operator:/root:/sbin/nologin 加上通配符^
阅读全文
摘要:find -name 名称查找 [root@rstx-53 test]# ls eth0 ETH0 file1 file2 file3 file4 file5 [root@rstx-53 test]# find ./ -name 'eth0' ./eth0 #####find -iname 名称查找
阅读全文
摘要:工作模式 逐行读取 awk 'BEGIN{print "hello"} {print "ok"} END {print "word"}' /etc/passwd BEGIN 读取文件之前做的操作 print ok 逐行读取文件 每一行打印一个ok END 读取文件之后做的操作 1 查 1.1)打印整
阅读全文
摘要:按照行模式处理数据 ####1查 #####1.1)打印单行信息 [root@iZbp130bctfwzi3oasr6raZ conf.d]# sed -n '1p' /etc/passwd root:x:0:0:root:/root:/bin/bash #####1.2)打印连续多行信息 1-3
阅读全文
浙公网安备 33010602011771号