countless are options si commands in linux, and I think I would have copied if I didn't have the option to move files older than 120 days from one folder to another.
Here is how we can move some files older than X days:
Commands via SSH :
find /home/cale/fisiere* -mtime +120 -exec mv /noua/destinatie/ {} \;
If we want to delete all files older than 30 days, from a folder…
find /cale/fisiere* -mtime +30 -exec rm -f {} \;
Must necessarily leave spaces -Mtime, Number of days, -Exec (Command line continues) rm (delete command - remove), argument " -f ”(Force delete), {} si \ ;.
It is possible that on some distributions of linux, "-F" should not work. Remove this argument from the line and everything will be ok.
* Tested on CentOS 5.3 (FT).
why does that command also delete the folder itself? I just want to delete the content! is there a solution? grazie
Capisco che hai diversi files nelle cartelle e vuoi solo shifte i files. Their cards remain intact. Correct? (GTrs).