I generally know what find ~ –mtime -30 -print does. It finds all the files that have been modified within the last 30 days. However, I can't figure out what -print is doing. Yes, I tried looking at the documentation, and it says it prints the full name followed by a new line. However, removing -print seems to achieve the same results. So what's the difference?
-print. But in this case, because I have-mtimeI need the-print? But then I don't understand why in this particular case, the results are the same. Do I need-printhere or not?-printaction is performed on all files for which the whole expression is true, unless it contains an action other than-pruneor-quit. Actions which inhibit the default-printare-delete,-exec,-execdir,-ok,-okdir,-fls,-fprint,-fprintf,-ls,-printand-printf."-printis used by default unless there's another action.-mtimeisn't an action, just a condition. It doesn't do anything. So, as you saw, you get the printing by default when all you have is-mtime(or other conditions). It's different if you havefind . -mtime -30 -exec true \; -printand remove the-print