Skip to content. | Skip to navigation

Personal tools
Log in
Sections
You are here: Home Knowledge Add additional file extension to all files

Add additional file extension to all files

by Akaname last modified Jul 04, 2011 04:18 PM

This will add an .old file extension to all files in the current directory, including all subdirectories. See the Linux manual pages "man bash", "man find", "man xargs" and "man mv".

find . -type f -name "*" | xargs -t -i mv {} {}.old

This will add date and time as a file extension to all files in the current directory, including all subdirectories. Very useful for backups. See the Linux manual pages "man bash", "man find", "man xargs", "man mv" and "man date".

find . -type f -name "*" | xargs -t -i mv {} {}.`date +%F-%H:%M:%S`
Filed under:
Akaname (垢嘗) licks it...

Sekien Akaname

Akaname is a long tongued japanese demon

Usually, it comes in the night to lick the mud out of the bathtub. Take care and don't forget to clean your bathtub properly!