Saturday, December 4, 2010

Using find command in linux

Using find command in linux


find is a powerful command in linux. If u understand it then u can do most thing using it. but in this post i am not going to teach the full power of  it but some basic usage.

This is a simple one finding any .txt file in the home directory of vallu with exact size of 100kb


$find /home/vallu -name "*.txt" -size 100k

here this is a simple one finding any .txt file in the home directory of vallu with size greater than 100kb

$find /home/vallu -name "*.txt" -size +100k
here this is a simple one finding any .txt file in the home directory of vallu with size lesser than 100kb

$find /home/vallu/ -name "*.txt" -size -100k
this is also a simple command which finds any picture with .jpg extenstion which was accesed in past 5 mins


$find /home/vallu/ -name "*.jpg" -amin -5

this command finds any text file which are modified in last one min


$find /home/vallu -name "*.txt" -mmin -1


this command finds any text file which are created in last one day(24 hrs)

$find /home/vallu -name "*.txt" -ctime -1

0 comments:

Post a Comment