cz en skin contact

[ slady | who is slady | work ]

[ ]

UNIX rename

If you want a simple script to rename all the files in the directory to a lowercase version, no matter what it was before (lower-, upper-, mixed-case), here is the script:


#!/bin/bash

for x in * ; do
	l=`echo -n $x|tr 'A-Z' 'a-z'`
	if [ $x != $l ] ; then
		mv $x $l
	fi
done

Simply copy the text above to a text file, make the file executable, and run it.



Content and Webdesign Copyright © 2005, 2008, 2010 Petr Sládek alias slady