由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Unix版 - [转载] 问一个问题
相关主题
How to find a file in the deep children directory?Help!
where can I find the C' headfiles?请问显示可用打印机的命令
a question about "find"?a question about using ftp dl music file
FTP Help文件的LINK到底有什么用处?
Is there any software can D/L a whole directory?how to enter a directory like "..a pub" ? Thanks
A simple question!为什么Netscape启动以后就自动关闭?
gcc in mac OSXwhat is the "core" in directory.
Apache中如何加入用户和口令?what's wrong with my CXterm5.0?
相关话题的讨论汇总
话题: txt话题: dat话题: 问题话题: mv话题: mildseven
进入Unix版参与讨论
1 (共1页)
M*******n
发帖数: 508
1
【 以下文字转载自 Linux 讨论区 】
【 原文由 MildSeven 所发表 】
怎么用shell语言把一个目录下的.txt文件后缀名变为.dat?
多谢
r*****s
发帖数: 985
2
ls *.txt | sed 's/\(.*\)txt/mv & \1dat/' | sh

【在 M*******n 的大作中提到】
: 【 以下文字转载自 Linux 讨论区 】
: 【 原文由 MildSeven 所发表 】
: 怎么用shell语言把一个目录下的.txt文件后缀名变为.dat?
: 多谢

c****r
发帖数: 185
3
for i in `ls *.txt`; do mv $i ${i/.txt/.dat}; done

【在 r*****s 的大作中提到】
: ls *.txt | sed 's/\(.*\)txt/mv & \1dat/' | sh
r****d
发帖数: 375
4
find . -name '*.txt' -print | while read file; do mv $file ${file%.*}.dat;
done
This one finds all the txt files in the directory/sub_directories.

【在 c****r 的大作中提到】
: for i in `ls *.txt`; do mv $i ${i/.txt/.dat}; done
1 (共1页)
进入Unix版参与讨论
相关主题
what's wrong with my CXterm5.0?Is there any software can D/L a whole directory?
how to write robort in perl w/out expect?A simple question!
what command is for changing the directory name?gcc in mac OSX
I am crazy about this!!Apache中如何加入用户和口令?
How to find a file in the deep children directory?Help!
where can I find the C' headfiles?请问显示可用打印机的命令
a question about "find"?a question about using ftp dl music file
FTP Help文件的LINK到底有什么用处?
相关话题的讨论汇总
话题: txt话题: dat话题: 问题话题: mv话题: mildseven