Following command finds .html files in the current working directory and changes the extension to .htm. The command illustrates the use of rename with find's exec switch. A quick way of finding and renaming files.
find . -name "*.html" -exec rename .html .htm {} \;
Find is regarded as a power command by many Linux users. The above example supports the claim ! There are many seemingly complicated or time consuming tasks which can be done quickly with commands.
Removing everything older than a year..
ReplyDeletefind . -mtime +365 -exec rm -r {} \;