Ddd an extension to multiple files in different location:
$ EXT=`date "+%m%d%y.%H.%M"`
$ find . -type f -name "name" | xargs -i mv {} {}.$EXT
For example rename all *.bak file as *.txt, enter:
$ rename .bak .txt *.bak
Remove all blank space with rename command:
$ rename "s/ *//g" *.mp3
To remove .jpg file extension, you write command as follows:
$ rename 's/\.jpg$//' *.jpg
To convert all uppercase filenames to lowercase:
$ rename 'y/A-Z/a-z/' *
source http://snippets.dzone.com/posts/show/6136
Đăng ký:
Đăng Nhận xét (Atom)
Không có nhận xét nào:
Đăng nhận xét