e********r 发帖数: 2352 | 1 Thank you for reply.
Could you help me show
model10*
model100*
model101*
If I use
echo model10\*
It shows:
model10*
echo model10*\*
It shows:
model10**
echo model10*
model10 model100 model101 |
|
r*****z 发帖数: 906 | 2 $touch model10* model100* model1000*
$ls
model10* model100* model1000*
$rename 's/\*//' model10*\*
$ls
model10 model100 model1000 |
|
e********r 发帖数: 2352 | 3 文件包含很多类似的文件名,但是最有都以'*'结尾,想要把'*'去掉
例如:
model10*
model100*
...
需要重命名为:
model10
model100
...
for i in `ls`; do mv -f $i `echo $i | sed 's/.$/_/'`; done
只能把文件名改为:
model1_*
model10_*
对'*'无能为力
请教如何重命名,'*'总是默认为正则表达式的一部分. |
|
e********r 发帖数: 2352 | 4 I tried all your guys' method. They all do not work. The reason is:
echo modle10* will show:
model10 model100 model101 model102 ...
then
sed 's/\*//g' will cause:
model10 and modle10 has same name
model100 and model100 has same name
modle101 and model101 has same name |
|
S*********n 发帖数: 387 | 5 来自主题: GunsAndGears版 - 家防左轮? 为啥大家都推荐 686 而不是MODEL 10 呢?价钱差不多。MODEL10 曾经多少年是警察的
标准配枪啊 |
|
h**e 发帖数: 171 | 6 来自主题: GunsAndGears版 - 家防左轮? 记得MODEL10是38 Special。686 是 357 + 38 Special。 |
|
r*****z 发帖数: 906 | 7 一般的系统上都有个rename的命令,是一个perl脚本
rename 's/\*//' model10*\*
就可以改名了 |
|