Saturday, September 02, 2006

Useful scripts

I just paste them here so that are easier for me to find them.

chown -R root:mp3 *; chmod -R 660 *;
find ./ -type d -exec chmod 770 {} \;

for i in *; do mv "$i" "$(echo "$i" | tr [A-Z] [a-z])";

for i in *;
do echo "$(expr "$i" : '.*\([0-9][0-9][0-9][0-9]\)') - ${i%\(*\)}";

The first one sets the right permissions for my mp3 folders and files, the second one converts all file names to lower case, and the last one renames folders in the form "the album name (1996)" to "1996 - the album name".

No comments: