s o m e t h i n g a b o u t m e

files renaming

How to add some string to all file names in current dictionary?

traut@traut-laptop:~/test$ ls
filename1.txt  filename2.wav  filename3.odt
traut@traut-laptop:~/test$ ls -1 | while read filename; \
> do \
> NAME=${filename%.*}; EXT=${filename#*.}; mv ${NAME}.${EXT} ${NAME}_mark.${EXT}; \
> done
traut@traut-laptop:~/test$ ls
filename1_mark.txt  filename2_mark.wav  filename3_mark.odt
traut@traut-laptop:~/test$

RSS feed | Trackback URI

»

Name (required)
E-mail (required - never shown publicly)
URI
Subscribe to comments via email
Your Comment (smaller size | larger size)
You may use <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> in your comment.