Showing posts with label extension. Show all posts
Showing posts with label extension. Show all posts

Friday, August 22, 2008

Convert a set of file extensions

I was wondering how to convert a set of txt files to doc

this could be done using this shell script:

example:
for x in *.txt;
do mv "$x" "${x%.txt}.doc";
done


steps to reproduce:

# touch 1.txt 2.txt 3.txt
# for x in *.txt;do mv "$x" "${x%.txt}.doc"; done
# ls
1.doc 2.doc 3.doc