1.查找文件 find ./ -name "name.txt" (精准匹配)
2.去掉文件夹下,所有文件的prefix_前缀,比如prefix_text.txt -> text.txt
for f in `ls`; do mv $f `echo $f | sed "s/^prefix_//g"`; done
3.给文件夹下所有文件加一个前缀prefix_
for f in `ls`; do mv $f "prefix_$f"; done
1.查找文件 find ./ -name "name.txt" (精准匹配)
2.去掉文件夹下,所有文件的prefix_前缀,比如prefix_text.txt -> text.txt
for f in `ls`; do mv $f `echo $f | sed "s/^prefix_//g"`; done
3.给文件夹下所有文件加一个前缀prefix_
for f in `ls`; do mv $f "prefix_$f"; done