列出常用的命令和最常用的用法,排名不分先后:)
1. find
在/home目录下查找以.txt结尾的文件名
find /home -name "*.txt"
同上,但忽略大小写
find /home -iname "*.txt"
2. grep
在文件中搜索一个单词,命令会返回一个包含“match_pattern”的文本行:
grep match_pattern file_name
grep "match_pattern" file_name
列出包含字符的文件
ll|grep word
3. vi中替换
:s/well/good/g 替换当前行所有 well 为 good
:n,$s/well/good/ 替换第 n 行开始到最后一行中每一行的第一个 well 为 good
4. top
查看CPU使用率