AMP AMP
AMP
0
AMP

How to find recently modified files and delete it

I need to filter the recently modified files in one of my user directory and also it should be removed.

Is there any script i need to run...??

find command Add a comment
a sample image
connor
asked Feb 07 2017

Answer

AMP
0
AMP

Find command is enough to do this process...

For example: If some files are modified in test1 user's Desktop, use the following command.

# find /home/test1/Desktop -cmin -60

This command will give the modified files for last 60 minutes, for days just change it to -ctime and mention the days.

To find and delete with the same command, use below

# find /home/test1/Desktop -cmin -60 -exec rm -f {}\;
Add a comment
a sample image
jagannatharumugam
asked Feb 07 2017
edited Oct 05 2018
Post your Answer