2013年8月2日 星期五

find 用法

http://blog.miniasp.com/post/2010/08/27/Linux-find-command-tips-and-notice.aspx
find ./ -iname *match* #查檔名,大小寫忽略
find ./ -maxdepth 1 -iname 'cgi' -type d  # 查深度為1的資料夾


查某個資料夾(當該路徑下有很多資料夾時)
http://stackoverflow.com/questions/4923834/how-to-ls-only-one-level-deep
方法1:
$ ls -d H2* -l
方法2:
$ ls -l | grep H2*

刪除專案下所有*.log檔案
http://unix.stackexchange.com/questions/116389/recursively-delete-all-files-with-a-given-extension
$ find ./ -iname *.log -type f -delete
再查一次,發現log檔都被刪除了
$ find ./ -iname *.log







沒有留言:

張貼留言