There are many reasons you may want to use quick one liner solutions to
solve your questions while either using the system or administering the
system. this section is aiming to provide answers to such actions.
-xdev only searches the local disk, very useful if you are mounting NFS disks.
Note
You may want to add a '-path '/proc' -path '/dev' -prune' or
otherwise keep find out of /dev/ and proc
2.
How can I delete files named nnn.nnn~ via cron ?
Log in as root and execute crontab -e, add a line like this:
0 1 * * * find / -name '*~' -exec rm {} \;
This command will execute everyday at 1 o'clock in the morning and
remove all files that end with a ~. If you want to delete
core files,
replace *~
with core
above.
3.
How can I rename multiple files ? I'd like to change all my pictures from IMG_xxxx.JPG to
Disneyland_xxxx.JPG
man mmv assuming that you have mmv
installed on your system. Your example would be:
mmv "IMG_*.JPG" "Disneyland_#1.JPG"
You could also use
mmv "IMG_*.*" "Disneyland_#1.#2"
if you had a mix of .JPG and .jpg images that you wanted to rename at
once.