【CentOS 7笔记13】,find用法和文件传输#171025
生活随笔
收集整理的這篇文章主要介紹了
【CentOS 7笔记13】,find用法和文件传输#171025
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
2019獨角獸企業(yè)重金招聘Python工程師標(biāo)準(zhǔn)>>>
hellopasswd
一. find
1. 跟find相似的命令
which ls #從環(huán)境變量$PATH中查找whereis ls #在事前準(zhǔn)備好的庫中查找,但必須提前更新locate [root@localhost ~]# yum install -y mlocate updatedb #手動更新 locate ls find /etc/ -name "network-scripts" find /etc/ -name "network*"[root@localhost ~]# find /etc/ -type d -name "network*" #指定目錄 [root@localhost ~]# find /etc/ -type f -name "network*" #目錄或文件 [root@localhost ~]# find /bin/ -type l -name "system*" #軟鏈接文件 [root@localhost ~]# find /dev/ -type b -name "tty*" #塊設(shè)備文件 [root@localhost ~]# find /dev/ -type c -name "vcsa*"[root@localhost ~]# stat 2.txt #查看文件的具體信息mtime #最近更改信息 Modifyctime #Changeatime #Access[root@localhost ~]# echo "123" >> 2.txt [root@localhost ~]# start 2.txt#Modify變化了#Change變化了 [root@localhost ~]# cat 2.txt [root@localhost ~]# stat 2.txt#Access[root@localhost ~]# find / -type f -mtime -1 #一天以內(nèi) [root@localhost ~]# find / -type f -mtime +1 #大于一天[root@localhost ~]# find /etc/ -type f -mtime -1 -name "*.conf" #時間一天以內(nèi)并且后綴為.conf的文件或目錄[root@localhost ~]# find /etc/ -type f -o -mtime -1 -o -name "*.conf" #-o或者,時間一天以內(nèi)或者后綴為.conf的文件或目錄 硬鏈接查找方式 [root@localhost ~]# find / -inum (inode號) 硬鏈接查找實驗 [root@localhost ~]# ln /home/1.txt /tmp/2.txt [root@localhost ~]# ls -i /home/1.txt [root@localhost ~]# find / -inum (inode號) [root@localhost ~]# find /root/ -type f -mmin -60 #60分鐘,一個小時[root@localhost ~]# find /root/ -type f -mmin -60 -exec ls -l {} \;[root@localhost ~]# find /root/ -type f -mmin -60 -exec mv {}{}.bak \; [root@localhost ~]# find /root/ -type f -mmin -60[root@localhost ~]# find /root/ -size +10K #大于 [root@localhost ~]# find /root/ -size -10K #小于 [root@localhost ~]# find /root/ -type f -size -10K -exec ls -lh {} \; [root@localhost ~]# find /root/ -type f -size +10M -exec ls -lh {} \;二. 常見文件名后綴
*.php #php文件 *.so #庫文件 *.bz2 #bzip2壓縮文件 *.gz #gzip壓縮文件 *.tar #tar打包文件 *.tbz #tar打包并用bzip壓縮 *.tgz #tar打包并用gzip壓縮 *.txt #純文本 *.conf #配置文件 *.lock #用于判斷一個文件或設(shè)備是否被使用 *.rpm #軟件包 *.c #c語言源程序代碼文件 *.cpp #c++源程序代碼文件 *.h #c\c++程序頭文件 *.o #程序目標(biāo)文件 *.java #java源程序代碼文件 *.class #java編譯文件 *.py #python源程序代碼文件 *.pl #perl腳本文件三. 使用宿主機(jī)和虛擬機(jī)傳輸文件
使用xshell或者secure CRT [root@localhost ~]# yum install -y lrzsz #安裝包[root@localhost ~]# sz file #linux傳輸?shù)絯indows[root@localhost ~]# rz #windows傳輸?shù)絣inux適用于SecureCRT和XShell
【CentOS 7基礎(chǔ)筆記11】,目錄權(quán)限,所有者與所有組,隱藏權(quán)限
【CentOS 7基礎(chǔ)筆記12】,幾種特殊權(quán)限與軟硬鏈接
【CentOS 7基礎(chǔ)筆記13】,find用法和文件傳輸
【CentOS 7基礎(chǔ)筆記14】,其他
【CentOS 7基礎(chǔ)筆記15】,用戶與用戶組
修改于171025
轉(zhuǎn)載于:https://my.oschina.net/hellopasswd/blog/1556274
總結(jié)
以上是生活随笔為你收集整理的【CentOS 7笔记13】,find用法和文件传输#171025的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 《Python语言程序设计》——1.2
- 下一篇: linux 下使用genymotion