Thursday, 22 August 2013

file manupulation through linux command

Looking for file modified on specific date:

find /path/to/dir -type f -name "*" -newermt yyyy-mm-dd ! -newermt yyyy-mm-dd

find  -type f -name "*" -newermt 2013-08-06 ! -newermt 2013-08-07

-- It will list out all file modified on the 2013-08-06 (6 Aug)

Looking for the file modified in last x days

find /directory_path -mtime -1 -ls

--- It will give list of file modified within 24 hrs

find /directory_path -mtime -5 -ls

-- It will give list of file modified in last 5 days

find /home/you -iname "*.txt" -mtime -60 -print

-- we can specify tile type before -mtime option.

 

 

 

 

No comments :

Post a Comment