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

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 运维知识 > linux >内容正文

linux

自学linux指令分析-find

發(fā)布時間:2024/9/5 linux 36 豆豆
生活随笔 收集整理的這篇文章主要介紹了 自学linux指令分析-find 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

自學(xué)linux指令分析-find

?

1·命令格式

find pathname -options [-print -exec -ok ...]

find / -type f -name "freedom"

2·命令參數(shù)

-print ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?將查找到的文件輸出到標(biāo)準(zhǔn)輸出

-exec?? command?? {} \; ? ? ? ? ? ? ?將查到的文件執(zhí)行command操作,{} 和 \;之間有空格

-ok ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?和-exec相同,只不過在操作前要詢用戶

-name ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 接“文件名字”查找

-mtime +4 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 4天之前

-mtime -4 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?4天之內(nèi)

-mtime 4 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 第4天

?

?3、命令功能

?用于查找文件,并作出相應(yīng)的處理

?

4、命令范列

[root@ban ~]# find / type f -mtime +5? 找出5天前的使用記錄

?[root@ban ~]# find /root/ -type f -mtime +5? 找出/root/目錄下5天前改過的文件全部找出來

/root/.bash_logout

/root/.cshrc

/root/.tcshrc

/root/.bash_profile

/root/anaconda-ks.cfg

/root/install.log.syslog

/root/install.log

/root/.viminfo

[root@ban ~]# find /root/ -type f -mtime -5 找出在/root/目錄下最近5天改過的文件全部找出來

/root/.bash_history

?

[root@ban ~]# find ?/root/ ?-type f ????-name "*.log" ?????????-mtime ?+5??

? ? ? ? ? ? ? ? ? ? ? ?指令? 目錄?? 類型文件? 名字“*代表所有.log” ? ? 修改時間 +5代表5天之前

[root@ban ~]# find ?/root/ ?-type f ????-name "*.log" ?????????-mtime ????

? ? ? ? ? ? ? ? ? ? ? ?指令? 目錄?? 類型文件? 名字“*代表所有.log” ? ? 修改時間 5代表之前第5天

[root@ban ~]# find /root/ -type f -name "*.log" ?-mtime +5|xargs rm –f 刪除5天前的過期后綴名為log的文件

轉(zhuǎn)載于:https://www.cnblogs.com/linuxfreedom/p/6696734.html

總結(jié)

以上是生活随笔為你收集整理的自学linux指令分析-find的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

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