find——檔案尋找命令 linux一些常用命令

來源:互聯網
上載者:User

標籤:blog   http   使用   檔案   ar   art   linux   log   

find 命令
eg:

一般檔案尋找方法:

1.  find /home -name file  ,  在/home目錄下尋找檔案名稱為file的檔案
2.  find /home -name ‘*file*‘  ,  在/home目錄下尋找檔案名稱包含file的檔案
3.  find /home -name ‘file*‘  ,  在/home目錄下尋找以file開頭的檔案名稱的檔案
4.  find /home -size 512c  ,    在/home目錄下尋找512kb大小的檔案
5.  find /home -size +1000000c  , 在/home目錄下尋找大於1000000kb的檔案
6.  find /home -size -1000000c  , 在/home目錄下尋找小於1000000kb的檔案
7.  find /home -size +1000000c -ls | less  , 在/home目錄下尋找大於1000000kb的檔案,並且用less命令的形式顯示詳細資料

根據檔案的特徵查詢方法:

8.  find / -amin -10   , 尋找在系統中最後10分鐘訪問的檔案
9.  find / -atime -2  ,  尋找在系統中最後48小時訪問的檔案
10. find / -empty  ,  尋找在系統中為空白的檔案或者檔案夾
11. find / -group cat , 尋找在系統中屬於 groupcat的檔案
12. find / -mmin -5  , 尋找在系統中最後5分鐘裡修改過的檔案
13. find / -mtime -1  ,  尋找在系統中最後24小時裡修改過的檔案
14. find / -nouser   ,  尋找在系統中屬於作廢使用者的檔案
15. find / -user rachel  ,  尋找在系統中屬於rachel這個使用者的檔案

使用混合尋找方式尋找檔案:

16. find /tmp -size +10000000c -and -mtime +2  , 在/tmp目錄中尋找大於100000000位元組並且在48小時內修改的某個檔案
17. find /tmp -size +10000000c -or -mtime +2  , 在/tmp目錄中尋找大於100000000位元組或者在48小時內修改的某個檔案
18. find /tmp ! -user rachel  ,  在/tmp目錄中尋找所有不屬於rachel的檔案

 

http://blog.csdn.net/hackerain/article/details/7946193

 

  1. tar -zxvf /home/images.tar.gz -C /specificdir  //解壓到指定的目錄  
  2. 查看當前所有進程

ps -e  

查看外網ip  

curl ifconfig.me  

  1.  查看CPU型號  
  2. cat /proc/cpuinfo  
    1.  cp(copy):檔案複製  
    2.    eg: cp ./test/test1/file1 ./test/test2 , 將目前的目錄的test/test1目錄中的file1檔案複製到目前的目錄的test/test2目錄中。  
    3.        cp /home/rachel/test/test1/file1 /home/rachel/test/test2 ,將/home/rachel/test/test1/目錄中的file1檔案複製到/home/rachel/test/test2目錄中。  
    4.        cp -ax ./test/test1/test11 ./test/test2 , 將test11目錄及其子目錄和其中包含的檔案全部複製到test2目錄下,< -ax中,a(archive)的意思是複製所有的目錄,包含子目錄,x的意思是複製後此檔案的格式將與目標扇區的檔案系統的相同>  
    5.        cp -ax ./test / , 複製目前的目錄下的test目錄及其子目錄到根目錄下。(注意這裡有許可權限制,得用sudo命令才可以進行複製) 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.