linux 實用命令find grep 備忘

2021-07-03 19:20:39 字數 537 閱讀 7319

/* 2015-05-17 */

/* 快速查詢多個檔案中的指定文字 */

## find ./ -name "*.c" -exec grep "10000000" -n -h {} \; | grep "return" | grep "has"

注意:1. 不解釋各命令 具體option 的 具體用法;

2. find -option 「」 可單獨使用 來查詢檔案;

3. grep的選項, -h 顯示具體檔案, -n 顯示行號;

/* 2017-03-27 */

/* pc需要關機-只能後台 */

## while

true; do mt tms dis i >> /mnt/collect.log; mt dis msw mod >> /mnt/collect.log; sleep 2 ; done &

# top >> /mnt/collect.log &

Linux實用命令

1.掛載samba檔案系統 mount t cifs o username guest,password adobe,codepage cp936,iocharset utf8 192.168.4.20 samba mnt samba 2.cp a 遞迴拷貝目錄,保留鏈結 d 拷貝時保留鏈結 f 覆...

Linux實用命令

1 根據url統計pv zcat domain.access.log 20150722.gz grep 22 jul.tags index wc l grep後面的是匹配url的正則,wc l是只輸出行數 2 根據ip統計uv zcat domain.access.log 20150722.gz g...

linux實用命令

1.遞迴所有目錄 ls r 2.top檢視特定程序資源占用 top hp pid 3.檢視當前目錄下有多少個檔案 find wc l 4.gbd除錯程序 gdb p 程序pid 5.顯示目錄和符號鏈結資訊 ls ld 6.檢視linux倒數1000行系統日誌 tail n 1000 var log ...