Linux Find command
-
Ok so looking to the community as I'm working on production and I don't want to screw up.
find /home/FTP/* -type file -mtime +14 -print > ~/ftp-files-old.txt
The goal is to look in every sub from /home/FTP/ and find any files older than 14 days and output the list into that document.
Is this the right way to do this?
-
@dustinb3403 said in Linux Find command:
Ok so looking to the community as I'm working on production and I don't want to screw up.
Should be...
find /home/FTP ....
-
Otherwise, looks fine.
-
@scottalanmiller said in Linux Find command:
@dustinb3403 said in Linux Find command:
Ok so looking to the community as I'm working on production and I don't want to screw up.
Should be...
find /home/FTP ....
find /home/FTP -type file -mtime +14 -print > ~/ftp-files-old.txt
So that should work?
-
@dustinb3403 said in Linux Find command:
@scottalanmiller said in Linux Find command:
@dustinb3403 said in Linux Find command:
Ok so looking to the community as I'm working on production and I don't want to screw up.
Should be...
find /home/FTP ....
find /home/FTP -type file -mtime +14 -print > ~/ftp-files-old.txt
So that should work?
Looks right
-
@scottalanmiller Cool.
Thanks for the help.
-
Hrm. . .
One more thing, would it be possible to print the last access date to this some how?
-
@dustinb3403 said in Linux Find command:
Hrm. . .
One more thing, would it be possible to print the last access date to this some how?
Possible, yes. Easy. No since the find command never shows that.
-
@scottalanmiller said in Linux Find command:
@dustinb3403 said in Linux Find command:
Hrm. . .
One more thing, would it be possible to print the last access date to this some how?
Possible, yes. Easy. No since the find command never shows that.
Would there be a better approach? I'm trying to create a list of things to make people clean up their crap, and I can show them "hey this hasn't been access in X years. . . delete it or I will"