$
Linux练习
练习
教程
English
한국어
日本語
中文
terminal
Welcome to Linux Practice Terminal!
Type "help" to see available commands.
user
@linux:
~
$
管道基础
重置课程
学习使用grep搜索文本,以及使用管道连接命令。
步骤 1
使用grep在日志文件中搜索"ERROR"。
输入:grep ERROR documents/log.txt
grep ERROR documents/log.txt
步骤 2
使用管道做同样的事情:用cat读取文件并通过管道传给grep。
步骤 3
使用grep和wc统计有多少ERROR行。
步骤 4
在联系人文件中搜索"example"。
步骤 5
使用-i标志进行不区分大小写的"info"搜索。