May 05, 2004

Rename every file to filename.txt

Charm allowed me to download all my LJ entries this month as text files but unfortunately they were not named with .txt which PyBloxsom requires to pick them up as postings. Again, some googling found me some Unix find command examples from which I was able to adpat an example to write this code

find . -type f -name "*" -exec mv {} {}.txt \;

which renames every file under the current directory to .txt.

Posted by stuartcw at May 5, 2004 08:24 PM
Comments