由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Linux版 - how to rename files -- waiting on line
相关主题
html给php传文件的问题,求解!how do I remove this file???
grep cannot handle "" ?rpm一问
quick help pls....命令输出里的文件名空格在 make 里面怎么保留?
how to copy one file into another?root file system 和kernel有什么不一样吗?
请问怎么把两个行数相等的文件合并起来?怎么找到所有的duplicate files?
please help: using 'cat' to merge large text files in linux请问ubuntu下面有没有类似windows 的disk cleanup and defragme
如何对linux文件夹进行比对? (转载)为什么bash file执行的结果与直接在命令行执行的结果不一样
best linux file manager?how to use sed command to replace ' into * ?
相关话题的讨论汇总
话题: rename话题: file话题: file001话题: files话题: line
进入Linux版参与讨论
1 (共1页)
jx
发帖数: 16
1
A simple question: say I have a series of files with naming file 000,
file001, file 002 ... file 200, how do I easily change their names to
file001, file002, file003 ... file 201?
Thanks!
jx
发帖数: 16
2
sorry, there is no space between 'file' and the numbers. I just want to add
1 to each file name.
jx
发帖数: 16
3
sorry, there is no space between 'file' and the numbers. I just want to add
1 to each file name.
m*****l
发帖数: 55
4
mv oldfilename newfilename
c******l
发帖数: 36
5
one pipe line:
command ls file??? | sort -r |
perl -lpe 's/file(\d\d\d)/sprintf("mv $_ file%03d",$1+1)/e' | sh
(not fully tested)

【在 jx 的大作中提到】
: A simple question: say I have a series of files with naming file 000,
: file001, file 002 ... file 200, how do I easily change their names to
: file001, file002, file003 ... file 201?
: Thanks!

Z****e
发帖数: 2999
6
shell only... haha ;)

【在 c******l 的大作中提到】
: one pipe line:
: command ls file??? | sort -r |
: perl -lpe 's/file(\d\d\d)/sprintf("mv $_ file%03d",$1+1)/e' | sh
: (not fully tested)

g****s
发帖数: 181
7
man rename
for example,
rename 's/1$/2/' *1
This will rename file001,file011 to file002,file012.
t*****g
发帖数: 1275
8
for ((i=201;i>=1;i--)); do cmd=`printf "mv file%03d file%03d" $(($i-1)) $i`; eval $cmd; done

【在 jx 的大作中提到】
: A simple question: say I have a series of files with naming file 000,
: file001, file 002 ... file 200, how do I easily change their names to
: file001, file002, file003 ... file 201?
: Thanks!

1 (共1页)
进入Linux版参与讨论
相关主题
how to use sed command to replace ' into * ?请问怎么把两个行数相等的文件合并起来?
请问有好的vim cvs plugin 吗?please help: using 'cat' to merge large text files in linux
how to tar files in a folder whose last modified days from 7 days ago to now?如何对linux文件夹进行比对? (转载)
ubuntu下怎么sync and backup files ?best linux file manager?
html给php传文件的问题,求解!how do I remove this file???
grep cannot handle "" ?rpm一问
quick help pls....命令输出里的文件名空格在 make 里面怎么保留?
how to copy one file into another?root file system 和kernel有什么不一样吗?
相关话题的讨论汇总
话题: rename话题: file话题: file001话题: files话题: line