find命令,linux和windows互傳檔案

來源:互聯網
上載者:User

標籤:find   互傳檔案   

find命令
  • -name 指定名字搜尋
    [[email protected] ~]# find /etc/ -name "sshd_config"/etc/ssh/sshd_config

    模糊搜尋含有指定字元的檔案

    [[email protected] ~]# find /etc/ -name "sshd*"/etc/ssh/sshd_config/etc/systemd/system/multi-user.target.wants/sshd.service/etc/sysconfig/sshd/etc/pam.d/sshd
  • -type指定檔案類型,後面跟d,f,l,b,c.
    [[email protected] ~]# find /etc/ -type d -name "sshd*"[[email protected] ~]# find /etc/ -type f -name "sshd*"/etc/ssh/sshd_config/etc/sysconfig/sshd/etc/pam.d/sshd
  • -mtime最近變更檔內容的時間
  • -atime最近訪問檔案的時間
  • -ctime最近改動檔案的時間如許可權,大小等,改了mtime,ctime也跟著變了
    [[email protected] ~]# find /etc/ -type f -mtime -1 小於一天,+1是大於一天/etc/resolv.conf/etc/tuned/active_profile[[email protected] ~]# find /etc/ -type f -mtime -1 -name "*.conf" 小於一天並且檔案名稱為"*.conf",-o是或者。/etc/resolv.conf
  • -inum指定inode號,找永久連結檔案
    [[email protected] ~]# find / -inum 33583028/root/2.txt/tmp/2.txt.bak
  • -mmin -60一小時以內的
  • -exec可以把找到的檔案丟給後面的命令
    [[email protected] ~]# find /root/ -type f -mmin -12000 -exec ls -l {} \;-rw-------. 1 root root 3100 6月   8 23:46 /root/.bash_history-rwx------. 2 root root 0 6月   8 20:22 /root/2.txt[[email protected] ~]# find /root/ -type f -mmin -60 -exec mv {} {}.bak \;
  • -size -10k小於10k的檔案或者10M,必須帶單位
    [[email protected] ~]# find /root/ -type f -size -10k -exec ls -l {} \;-rw-r--r--. 1 root root 18 12月 29 2013 /root/.bash_logout-rw-r--r--. 1 root root 176 12月 29 2013 /root/.bash_profile-rw-r--r--. 1 root root 176 12月 29 2013 /root/.bashrc-rw-r--r--. 1 root root 100 12月 29 2013 /root/.cshrc-rw-r--r--. 1 root root 129 12月 29 2013 /root/.tcshrc-rw-------. 1 root root 1261 5月  28 19:09 /root/anaconda-ks.cfg-rw-------. 1 root root 3100 6月   8 23:46 /root/.bash_history-rw-r--r--. 1 root root 799 5月  30 21:11 /root/.ssh/authorized_keys-rw-r--r--. 1 root root 352 5月  31 23:19 /root/.ssh/known_hosts-rw-------. 1 root root 1675 5月  31 23:28 /root/.ssh/id_rsa-rw-r--r--. 1 root root 400 5月  31 23:28 /root/.ssh/id_rsa.pub-rwx------. 2 root root 0 6月   8 20:22 /root/2.txt
    stat查看檔案的詳細資料
    [[email protected] ~]# stat 2.txt 檔案:"2.txt"大小:0          塊:0          IO 塊:4096   普通空檔案裝置:803h/2051d   Inode:33583028    永久連結:1許可權:(0700/-rwx------)  Uid:(    0/    root)   Gid:(    0/    root)環境:unconfined_u:object_r:admin_home_t:s0最近訪問:2017-06-08 20:22:15.371780752 +0800最近更改:2017-06-08 20:22:15.371780752 +0800最近改動:2017-06-08 22:13:30.666649524 +0800建立時間:-
    檔案名稱尾碼
  • 檔案名稱區分大小寫
  • 檔案名稱的尾碼可以自訂,但並不能代表檔案的類型。

    linux和windows互傳檔案
  • yum install -y lrzsz安裝完後就可以使用了,sz命令可以從linux向windows傳檔案,rz命令可以從windiws向linux傳檔案

find命令,linux和windows互傳檔案

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.