Monday, July 20, 2009

เปลี่ยนนามสกุลไฟล์

After fooling around I found a good guide giving me the way out. First let play with the command for

for old in *.TTF; do echo $old; done

This will give me a list of all *.TTF files. Now to rename the file I use the command mv

mv something.TTF something.ttf

This just like renaming. I don't know how to use the command rename though. Finally to cutout only name without file's extension

for old in *.TTF; do echo `basename $old .TTF` ; done

This will give you the files without their extensions. Finnally I add the new extension .ttf to this and use the command mv to rename all file ending with .TTF to their old name but new extension .ttf

for old in *.TTF; do mv $old `basename $old .TTF`.ttf ;done

I know that I am just a nope showing something trivial to those who working with linux but, you know, it might be some people don't know this.

ที่มา : http://monoguy.exteen.com/20080901/rename-multiple-files-in-ubuntu

Sunday, July 19, 2009

Resize batch images in Ubuntu

resize batch images in Ubuntu

for i in `ls`; do convert -resize 800x800 -quality 65 $i resized_$i; done