论坛风格切换切换到宽版
  • 691阅读
  • 4回复

[问题求助][RedHat] 这个命令怎么不行啊? [复制链接]

上一主题 下一主题
离线justinwei.
 
发帖
2072
C币
-140234
威望
368
贡献值
1
银元
-2
铜钱
4597
人人网人气币
0
只看楼主 倒序阅读 使用道具 楼主  发表于: 2009-05-01
如果我用c.at /dev/null > t1,就可以清空t1这个.文件,           鲜花
如果我有两.个文件t1和t2,为什么我用cat /d.ev/null > *就不行了?虚拟主机
*不是可以代表所有文件的么? http://upload.bbs.csuboy.com/Mon_1004/126_6899_c7a6b4605790573.gif[/img]

[root@rhel5. tmp2]# ll(广告)
total 8
-rw-r--r-- 1 .root root  7 .Nov 21 20:30 t1             汽车
-rw-r--r-- 1 roo..t root 22 Nov 21 20:29 t2.
[r.oot@rhel5 tmp2]# cat *.
Peifei
Peifei is a g.ood man!           女人
[root@rhel5 tmp2]# cat ./dev/null .> *    美容
-bash: .*: ambiguous redi.rect.

评价一下你浏览此帖子的感受

精彩

感动

搞笑

开心

愤怒

无聊

灌水
离线buhuien.
发帖
2060
C币
-140284
威望
363
贡献值
1
银元
-1
铜钱
4428
人人网人气币
0
只看该作者 沙发  发表于: 2010-04-14
Re:[RedHat]
The  word  following the redirection operator in the following descrip-
       tions, unless otherwise noted, is subjected to brace  expansion,  tilde
       expansion, parameter expansion, command substitution, arithmetic expan-
       sion, quote removal, pathname expansion, and  word  splitting.   If  it
       expands to more than one word, bash reports an error.

离线卡西亚.
发帖
2146
C币
-60466
威望
407
贡献值
1
银元
-1
铜钱
4829
人人网人气币
0
只看该作者 板凳  发表于: 2010-04-14
Re:[RedHat]
cat /dev/null > filename,用*号不行吧

发帖
2004
C币
-193467
威望
388
贡献值
1
银元
-1
铜钱
4541
人人网人气币
0
只看该作者 地板  发表于: 2010-04-14
Re:[RedHat]


QUOTE:原帖由 tianlijian 于 2008-11-22 12:26 发表
The  word  following the redirection operator in the following descrip-
       tions, unless otherwise noted, is subjected to brace  expansion,  tilde
       expansion, parameter expansion, com ...

正解

离线billliy.
发帖
2043
C币
-60738
威望
390
贡献值
1
银元
-2
铜钱
4592
人人网人气币
0
只看该作者 4楼 发表于: 2010-04-14
Re:[RedHat]
路过学习一下。

既然这样可以写个脚本来清空超过两个文件。
快速回复
限100 字节
如果您在写长篇帖子又不马上发表,建议存为草稿
 
上一个 下一个