I have a few Linux Red Hat Linux machines and I must find some files on them. The problem is that they have a lot of files and folders since 2004 year. And I don't know where exactly to look for these files.
Is there some terminal command with which I can select a specific time range. I want to see every file which is changed from last month (May) to now.
Best Answer
Yes, the
find
command can do this. It will take some experimentation and reading and re-reading the man page to get it to do what you want, but is amazing command. Below are 2 examples:The 1st
find
uses-type f
to list only files.-type d
for directories.-ctime -2
is for files with a created time less than 2 days old and then adds them to the tar archive. I can't remember from when I used this command or why.The 2nd command checks for files and directories modified within the last 400 days and outputs that list to
files.txt
Here's a great info page I just found, too.Example, In my ~ on my personal laptop are files as old as 2010. And lots that are newer, too. By running
find . -ctime -1000 -ctime +600
, I get listing like this:In this case, the
Pictures
folder had legacy items copied over from before 2010, but which happened with the 400 day period 600 days ago.