日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

【CentOS 7笔记13】,find用法和文件传输#171025

發(fā)布時間:2025/3/15 编程问答 26 豆豆
生活随笔 收集整理的這篇文章主要介紹了 【CentOS 7笔记13】,find用法和文件传输#171025 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

2019獨角獸企業(yè)重金招聘Python工程師標準>>>

hellopasswd


一. find

1. 跟find相似的命令

which ls #從環(huán)境變量$PATH中查找whereis ls #在事前準備好的庫中查找,但必須提前更新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 #程序目標文件 *.java #java源程序代碼文件 *.class #java編譯文件 *.py #python源程序代碼文件 *.pl #perl腳本文件

三. 使用宿主機和虛擬機傳輸文件

使用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)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。