由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Unix版 - a question about rename
相关主题
a question about renaming.A question about awk
How to use files with names like "-123.txt"?help urgent!
shell script help?how to handle *.pkg files?
Any idea on batch renaming files?Solars question
how to turn off sendmail格式问题
有关Unix shell script的问题急问。。。urgent...在线等。。。
Re: [转载] 一个很急迫的问题,谢谢总结一下:如何在unix下一次性rename n-多个文件名
how to rename a bunch of filesRe: [转载] How to see a directory content in a http website?
相关话题的讨论汇总
话题: rename话题: renaming话题: file话题: names话题: files
进入Unix版参与讨论
1 (共1页)
T***B
发帖数: 137
1
I need to rename a bunch of files. The original file names would be like
these:
1254A.txt
23A.txt
89482A.txt
341A.txt
After renaming, the file names would be like:
1254B.txt
23B.txt
89482B.txt
341B.txt
In other words, the 'A' in the original file is replaces by 'B'. Is there any
easy way to do the renaming?
All the files are under a same directory.
Thanks.
s***e
发帖数: 108
2
fi u have rename
rename A.txt B.txt *A.txt

【在 T***B 的大作中提到】
: I need to rename a bunch of files. The original file names would be like
: these:
: 1254A.txt
: 23A.txt
: 89482A.txt
: 341A.txt
: After renaming, the file names would be like:
: 1254B.txt
: 23B.txt
: 89482B.txt

s**s
发帖数: 242
3
for i in $*
do
o=`echo $i|sed -e 's/A/B/'`
echo $i $o
mv $i $o
done

【在 T***B 的大作中提到】
: I need to rename a bunch of files. The original file names would be like
: these:
: 1254A.txt
: 23A.txt
: 89482A.txt
: 341A.txt
: After renaming, the file names would be like:
: 1254B.txt
: 23B.txt
: 89482B.txt

T***B
发帖数: 137
4
Thanks, sngle and seis.
rename A.txt B.txt *A.txt works pretty well in my computer.
seis's way is a little complicated for a Cai Niao like me.

any

【在 s**s 的大作中提到】
: for i in $*
: do
: o=`echo $i|sed -e 's/A/B/'`
: echo $i $o
: mv $i $o
: done

w*g
发帖数: 14
5
refer to 7426.

【在 T***B 的大作中提到】
: I need to rename a bunch of files. The original file names would be like
: these:
: 1254A.txt
: 23A.txt
: 89482A.txt
: 341A.txt
: After renaming, the file names would be like:
: 1254B.txt
: 23B.txt
: 89482B.txt

1 (共1页)
进入Unix版参与讨论
相关主题
Re: [转载] How to see a directory content in a http website?how to turn off sendmail
help on unix有关Unix shell script的问题
怎样同时改很多文件的名字。Re: [转载] 一个很急迫的问题,谢谢
standalone sun box questionhow to rename a bunch of files
a question about renaming.A question about awk
How to use files with names like "-123.txt"?help urgent!
shell script help?how to handle *.pkg files?
Any idea on batch renaming files?Solars question
相关话题的讨论汇总
话题: rename话题: renaming话题: file话题: names话题: files