rename all
I have 3 files in a directory
a.pc b.pc c.pc I need to rename all these in a single command to a.txt b.txt c.txt Please suggest me... |
Quote:
http://www.debian-administration.org/articles/150 |
Something like
Code:
rename ".pc" ".txt" *.pc Hope this helps, |
Quote:
|
Thank you every body
|
rename
Apologies first but am I right (snark 1994) that you are in the relevant directory and the wildcard (*) only affects that directory? Are the quotes (double or single) strictly necessary as you are in that directory?
Fred. |
I believe you're completely correct :) I was assuming you were in the directory, and yes the quotes aren't really necessary - it's just a matter of habit...
And lipun4u, if you think the thread has been solved, please click 'Mark thread as SOLVED' at the top of the page. Thanks |
no....it's not working.
HP Unix doesn't recognize 'rename' as a command.. |
Don't know about out HP Unix, but you could try this:
Code:
ls *.pc | xargs -I{} basename $1{} .pc | xargs -I{} mv -v -T $1{}.pc $2{}.txt Code:
while read line; do mv -v -T "$line" "${line%.*}.txt" ; done < <(ls *.pc) |
All times are GMT -5. The time now is 07:07 AM. |