The Linux utils package has a multiple rename command.
example:
rename JPG jpg *.jpg
The first argument is the from pattern. The second is the to pattern. The third is a wild card that selects the files you want to rename.
Here is a very common way of doing it:
Code:
for file in *.JPG; do
mv "${file}" "${file%JPG}jpg"
done
Look in the bash info manual for variable expansion. To change a prefix on a group of files, you could do something like:
Code:
for file in pics-*.jpg; do
mv "$pics" "photos-${pics#*-}"
done
To change a pattern in the middle you could do something like this:
Code:
for file in *\ *; do
mv "$file" "${file// /_}"
done
This replaces spaces in names with underscores. You may find yourself doing that
often for mp3 files.
If you have thousands of files, file globbing may fail because the shell runs out of memory. In that case, use the "find" command to generate a list of files and the xargs command to take a list of files in STDIN and use them as the arguments for a command. The xargs command lets you limit the number of files that are processed at once.
Code:
find ~/Documents/pictures/ -type f -print0 | xargs -0 md5sum >md5sumlist
The 100 or so most common console programs in /bin/ and /usr/bin/ are supplies by the coreutils package. I downloaded the source and ran
"./configure && make pdf" to generate the documentation in book form from the docbook info files source. Print it out and you have the documentation for most of the programs you would use in the console. Having a nicely formatted hard copy may make it easier to learn and remember.