Linux常用搜索命令:which ,find
上圖中grep的命令:
grep [option] pattern-file 用於查找某一個文件裏面的帶有什麼內容 option 可以省略
例如:
1 從文件中查找關鍵詞: grep 'linux' test.txt 代表從test.txt中查找linux這個關鍵詞
2. 找出以u開頭的行: grep ^u test.txt 代表從test.txt 中查找以u開頭的行, 前面用^ 表示
3. 找出以hat結尾的行: grep hat$ test.txt 代表從test.txt中查找以hat結尾的行,結尾用$表示
文件,文件夾的拷貝,移動,刪除命令