我常用的find命令
查詢某種型別檔案中包含特定字元的檔案
find /* -type f -name “*.php” |xargs grep “rename(“
find ./|xargs grep -ri “is_vip” -l
Linux下find一次查詢多個指定檔案或者排除某類檔案,在 GREP 中匹配多個關鍵字的方法
(1)Linux下find一次查詢多個指定檔案:
查詢a.html和b.html
find . -name "a.html" -name "b.html"
find . -regex `.*.txt|.*.doc|.*.mp3` find . -regex `.*.txt|.*.doc|.*.mp3`
./a.txt
./a.doc
./a.mp3
(2)排除某些檔案型別:
排除目錄下所有以html結尾的檔案:
find . -type f ! -name "*.html"
./ge.bak.02.09
./ge.html.changed.by.jack
./a.txt
./a.doc
./a.mp3
(3)排除多種檔案型別的示例:
find . -type f ! -name "*.html" -type f ! -name "*.php" -type f ! -name "*.svn-base" -type f ! -name "*.js" -type f ! -name "*.gif" -type f ! -name "*.png" -type f ! -name "*.cpp" -type f ! -name "*.h" -type f ! -name "*.o" -type f ! -name "*.jpg" -type f ! -name "*.so" -type f ! -name "*.bak" -type f ! -name "*.log"
(3)在 GREP 中匹配多個關鍵字的方法:
grep查詢多個數字的檔案:
-r 遞迴,-E:正則 -l:只顯示檔名
grep -r -E `0341028|100081|10086|10001` *
a.txt:100081
b.txt:10086
c/cc.txt:0341028
c/cc.txt:100081
c/cc.txt:10086
c/cc.txt:10001
c.txt:10001
d.txt:0341028
grep -r -E -l `0341028|100081|10086|10001` *
a.txt
b.txt
c/cc.txt
c.txt
d.txt
多種型別檔案示例:
find . -name "*.html" -o -name "*.js"|xargs grep -r "BusiTree"
(4)查詢系統大於100M的檔案
find / -type f -size +1000000k
相關文章
- Linux 常用基本命令 findLinux
- 常用find命令與xargs.txt
- 我常用的Linux命令Linux
- 我的常用Linux命令Linux
- Linux - find命令常用引數與示例Linux
- 我常用的那些linux命令Linux
- find 命令
- find命令
- linux中強大且常用命令:find、grepLinux
- 記錄Linux我常用的命令Linux
- find -newer命令
- linux下2條我常用的命令Linux
- 爹地,我找到了!15個極好的Linux find命令示例Linux
- 爹地 我找到了! 15個極好的Linux find命令示例Linux
- 幾個常用的文字處理shell 命令:find、grep、sort、uniq、sed、awk
- 媽咪,我找到了!15個實用的Linux find命令示例Linux
- 媽咪 我找到了! 15個實用的Linux find命令示例Linux
- Linux常用命令之檔案查詢which、find、locate命令講解Linux
- find 的命令的使用方法。
- sed命令和find命令的結合的使用
- find 命令入門
- grep、find命令整理
- Find命令總彙
- find命令詳解
- find 命令專題
- find 命令詳解
- linux find命令Linux
- linux find 命令Linux
- Find命令練習
- linux find 命令!Linux
- find 命令全面解析
- find 命令的引數詳解
- [shell基礎]——find命令
- find命令檔名字尾
- linux/unix find命令Linux
- Linux常用命令之 查詢命令 find —— 細說 -atime,-mtime,-ctimeLinux
- linux中file命令和find命令Linux
- Linux下find命令的用法(轉)Linux