RHCE 033 unit12

本文详细介绍在Linux环境下使用find和locate命令进行高效文件搜索的方法。包括快速查找特定文件、按权限和大小筛选文件、查找最近修改的文件等实用技巧。文章还提供了一些实际案例帮助读者更好地理解和应用这些命令。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

locate:

 

locate search  

 

ps:fastly speed

 

updatedb    every day 0:00  update files

 

find /etc -name 

 

find slowly   but  accurate

 

find -name snow.png

 

find -iname snow.png       case-insentment

 

find / -name '*.txt'

 

exaple: find /home -user joe -group joe

 

find -user joe -not -group joe

 

find -user joe -o -user jane     -o equal  -or

 

find -not /( -user joe -o -user jane /)      neither joe or jane

 

echo /cost: $5.00

 

find / -user joe -o -uid 500

 

find -perm 755    matches jf mode is exactly 755

 

/  find -perm +222   matches if anyone can write

 

find -perm -222   matches if everyone can write

 

find -perm -002 

 

find -size +10M    modifiers are aviliable   ps : k  M G  but not t or T

 

dd if=/dev/zero of=1.txt bs=1M count=10

 

ls -l list time  must be  mtime 

 

ctime when file data or metadata last changed

 

find /tmp -ctime +10    10day

 

-atime  when file was last read

 

-mtime when file fata last changed 

 

-ctime when file data or metadata lste changed

 

find /etc -amin -60     -60    durthing 60minute

 

find /var -size +1M |wc -l

 

find -size +100M -ok mv { } /tmp/largefiles/ /;     { } equal {}

 

find /etc/ -name *.conf -ok /bin/cp { } /tmp/{ }.orig /;

 

find /etc/ -name '*.conf' -exec cp { } /tmp/ /;

 

find -name '*.conf'  -exec cp { } { } .orig /;

 

find ~ -perm -002 -exec chmod 0-w { } /;

 

find /home -type d -ls

 

find -not -perm +111 -name '*.sh' -ok chmod 755 {}  /;

 

Which command will search your entire filesystem for a file named South.png?

find /all -name "South.png"
find / -file "South.png"
find / -name "South.png" -type f 2>/dev/null
find /all -file "South.png"


C
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值