Note that there must be spaces between rm, {} and \;
More Explanation:
The first argument is the path to the files you want to delete. This can be a path, a directory, or a wildcard as in the example above. I would recommend using the full path, and make sure that you run the command without the exec rm to make sure you are getting the right results.
The second argument, -mtime, and this switch is used to specify the number of days old that the file is. If you enter +30, it will find files older than 30 days.
The third argument, -exec, allows you to pass in a command such as rm. The {} \; at the end is required at the end the of the command.
NOTE:
Do not run this without testing it first... for example. always run first and look at the output, for example:
After you are happy it is working as you wish, then you can run it.. but honestly, here is what I do:
Better to move first and delete later!!! ALWAYS
Get in the very good habit of moving files before you delete them, especially using scripts where one fat finger mistake can ruin your day!