版权声明:https://mp.csdn.net/configure https://blog.csdn.net/jieniyan2680/article/details/88321971
-
cat 文件名
cat -b 对非空输出行编号
cat -n 对输出的所有行编号 -
more 文件名 (可以分屏显示)
-
grep 搜索文本文件名
例如 找123.txt 中hello
图形界面图形界面 CTRL+f 直接搜索就行 hello
-n
在终端 grep -n hello 123.txt (显示匹配行及行号)
-v
grep -v hello 123.txt (所有不包含hello的行都显示)
grep -vn hello 123.txt (所有不包含hello的行和行号都显示)
-i
grep -i (搜索不区分大小写的内容)
grep -in “hello python” 123.txt (所有包含hello python的行和行号都显示)
^a 首行,搜索以a 开头的行
ke$ 行尾,搜寻以ke结束的行