linux常用命令之檔案收索

來源:互聯網
上載者:User

linux常用命令之檔案收索

命令名稱: find

 

  317  find /etc  -name  iniy  318  find /etc -name servi*  319  find /etc -name init???  320  find /etc -iname init???  321  find / -size +204800 #1個資料快是512 位元組 是0.5k  322  find /home -user test  323  find /etc/ -cmin -5  324  find /etc/ -cmin -30  325  find /etc/ -size +163840 -a -size -204800  326  find /etc -name init* -a -type f  327  find /etc -name init* -o -type f
[root@localhost tmp]# find . -inum 1

命令名稱:locate

 

獲得檔案路徑

在檔案資料庫找尋找,並不是進行硬碟尋找,/tmp 目錄下updatedb也無法尋找

 

[root@localhost ~]# locate *init/bin/redhat_lsb_init/etc/rc.sysinit/etc/X11/xinit/etc/pam.d/run_init/etc/rc.d/rc.sysinit/etc/security/namespace.init/etc/sysconfig/init/sbin/capiinit/sbin/init/sbin/telinit/usr/bin/msginit/usr/bin/xinit/usr/kerberos/bin/kinit/usr/kerberos/bin/krb524init/usr/sbin/capiinit/usr/sbin/run_init/usr/share/doc/pam-0.99.6.2/txts/README.pam_keyinit/usr/share/doc/rp-pppoe-3.5/adsl-init/usr/share/logwatch/scripts/services/init/usr/share/system-config-netboot/diskless/diskless.init[root@localhost ~]# touch byf[root@localhost ~]# locate byf[root@localhost ~]# find byfbyf[root@localhost ~]# updatedb [root@localhost ~]# locate byf/root/byf[root@localhost ~]# locate -i BYF/root/byf[root@localhost ~]# 

 

命令名稱:which、whereis

得到命令存放在那個檔案,針對命令

 

[root@localhost ~]# which cpalias cp='cp -i'        /bin/cp[root@localhost ~]# which adduser/usr/sbin/adduser[root@localhost ~]# 


命令名稱: grep

 

尋找檔案內容,也就是關鍵字

 

  352  grep -i  multi* /etc/inittab  353  grep -v *a*  /etc/inittab  357  grep -v ^# /etc/inittab

 

聯繫我們

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