Bash Help: Renaming all files in a Directory

Jacques B. jjrboucher at gmail.com
Sat Jul 22 23:20:40 UTC 2006


> Off the top of my head...
> $ for f in *.jpg; do; mv $f `echo $f | sed 's/ //g'`; done
>
> hth
>
> --wpd

I was able to benefit from this tip as I had a bunch of web pages
printed to postscript files that I wanted to convert to pdf so I used
the command:

for f in *.ps; do ps2pdf "$f";done

It worked like a charm.

I love the command line tips & tricks because you can use them in so
many situations.

Jacques B.




More information about the users mailing list