LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1065|回复: 9

command 问题[基本解决]

[复制链接]
发表于 2004-4-2 07:07:47 | 显示全部楼层 |阅读模式
ls -exec wc -l {} \; and
ls | xargs wc -l

and the 2nd one worked but the 1st one gave an error message:

bash-2.04$ ls -exec wc -l {} \;
wc not found
-l not found
{} not found
; not found
发表于 2004-4-2 09:42:50 | 显示全部楼层

回复: command 问题

最初由 shaoping 发表
ls -exec wc -l {} \; and
ls | xargs wc -l

and the 2nd one worked but the 1st one gave an error message:

bash-2.04$ ls -exec wc -l {} \;
wc not found
-l not found
{} not found
; not found

1.xargs是把管道输出汇集后作为参数值供下一个命令使用。
2.ls没有像find一样的-exec选项!
 楼主| 发表于 2004-4-2 12:16:44 | 显示全部楼层
ls -l -exec wc -l {} \;

ls -l -exec wc -l {} \;
-bash: bash-2.04$: command not found
加-l 也不可以啦,,,
发表于 2004-4-2 12:32:30 | 显示全部楼层
最初由 shaoping 发表
ls -l -exec wc -l {} \;

ls -l -exec wc -l {} \;
-bash: bash-2.04$: command not found
加-l 也不可以啦,,,

-exec command {} \;是find的选项,在ls里是没有的!
出现-bash: bash-2.04$: command not found,可能是路径的问题,用绝对路径吧,/bin/ls -l
 楼主| 发表于 2004-4-2 12:44:59 | 显示全部楼层
请问pr 这命令怎样用,有这类的贴子吗? 谢谢.上楼):
发表于 2004-4-2 12:54:44 | 显示全部楼层
最初由 shaoping 发表
请问pr 这命令怎样用,有这类的贴子吗? 谢谢.上楼):

没用过这个命令,好像跟printer有关,建议看看他的manual ;)
man pr
 楼主| 发表于 2004-4-2 12:57:28 | 显示全部楼层
english 的,好难看。 我找中文的,但找不到....
 楼主| 发表于 2004-4-2 12:59:55 | 显示全部楼层
再请教一个问题,有bash入门的e书吗?最好有多一些练习的。

有什么方法可以快点提高在 bash shell 能力? 谢谢谢谢.
发表于 2004-4-2 13:04:05 | 显示全部楼层
最初由 shaoping 发表
再请教一个问题,有bash入门的e书吗?最好有多一些练习的。

有什么方法可以快点提高在 bash shell 能力? 谢谢谢谢.

可以去下面的地方"转转"
本版精华区
http://www.linuxsir.cn/bbs/forumdisplay.php?cool=1&forumid=60
和置顶区
 楼主| 发表于 2004-4-2 13:14:06 | 显示全部楼层
那里好多,"转转"... 有点头晕...! 晕
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表