ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、视频、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
#### grep ``` 从文件中搜索内容 ``` 搜索test.txt中是否存在test字符串 ``` root@ecs-a672-0002:/home/test# grep test test.txt test ``` 行号 ``` root@ecs-a672-0002:/home/test# grep -n test test.txt 7:test ``` ``` -v 搜索不存在的行 ``` 有多少行匹配 ``` root@ecs-a672-0002:/home/test# grep -c test test.txt 1 root@ecs-a672-0002:/home/test# grep -vc test test.txt 11 ```