d**o 发帖数: 29 | 1 I have files
a.out b.out c.out
How can I copy them to
a.bak b.bak c.bak
or
a.out.bak b.out.bak c.out.bak?
Thanks a lot. |
A**u 发帖数: 2087 | 2 ????
cp a.out a.out.bak
or
mv a.out a.out.bak
【在 d**o 的大作中提到】 : I have files : a.out b.out c.out : How can I copy them to : a.bak b.bak c.bak : or : a.out.bak b.out.bak c.out.bak? : Thanks a lot.
|
p*a 发帖数: 592 | 3 ls -1 *.out | xargs -i echo {} {} | sed 's/out$/bak/' | xargs -n2 mv
【在 d**o 的大作中提到】 : I have files : a.out b.out c.out : How can I copy them to : a.bak b.bak c.bak : or : a.out.bak b.out.bak c.out.bak? : Thanks a lot.
|
d**o 发帖数: 29 | 4
Thanks. But is there any much simpler version like using "find ..."?
【在 p*a 的大作中提到】 : ls -1 *.out | xargs -i echo {} {} | sed 's/out$/bak/' | xargs -n2 mv
|
j****y 发帖数: 31 | 5 for n in `ls *.out`; do cp $n $n.bak; done
you dont have to invoke so many applications :P
【在 d**o 的大作中提到】 : : Thanks. But is there any much simpler version like using "find ..."?
|
m**h 发帖数: 207 | 6 //admire
【在 p*a 的大作中提到】 : ls -1 *.out | xargs -i echo {} {} | sed 's/out$/bak/' | xargs -n2 mv
|