I am trying to use find command to delete some old file from backup folder but the find command return nothing, and so nothing is being removed! this is the code (find part), my system is ubuntu 18.04 LTS
find -name "*.sql" -type f -mtime +30
and the output of ls -l command is :
the result of ls -l command
I googled and searched the web but did find nothing to solve the problem. any help appreciated.
You are missing the starting point for your
findcommand, in this case.because you already execute the command in the target directory:the rest can stay the same. First make sure it gives you the correct result and afterwards you can tack on the
-execto execute a command for each line of the result.You can usually find such answers on the UNIX stackexchange: How to execute ln on find results