红联Linux门户
Linux帮助

求教2个问题

发布时间:2010-08-17 11:32:59来源:红联作者:litao871104
[i=s] 本帖最后由 litao871104 于 2010-8-28 19:31 编辑 [/i]

1..echo >foo 生成一个一个空文件 为什么用wc -c foo命令后会显示有1一个字符 这个字符是什么

2.一个题目: 根据下面内容回答问题

【student@station student】$ ls -s /etc/group
4 /etc/group
【student@station student】$ ls -l /etc/group
-rw-r--r-- 1 root root 2475 Aug 17 12:34 /etc/group

(1)使用wc -l (2)使用wc -c
文章评论

共有 4 条评论

  1. zdl_361 于 2010-08-18 21:04:08发表:

    1..echo >foo 生成一个一个空文件 为什么用wc -c foo命令后会显示有1一个字符 这个字符是什么
    echo会在输出的信息结尾输出换行符号.echo >foo建立的不是空文件,如果不要换行符号使用echo -n
    2.一个题目: 根据下面内容回答问题

    【student@station student】$ ls -s /etc/group
    4 /etc/group
    【student@station student】$ ls -l /etc/group
    -rw-r--r-- 1 root root 2475 Aug 17 12:34 /etc/group

    (1)使用wc -l 这个取决于你的具体内容计算的是行的数目.
    (2)使用wc -cwc -c的结果等于文件包含的字节数目也就是2475

  2. yanlong938 于 2010-08-18 00:23:06发表:

    (1)使用wc -l (2)使用wc -c
    看你/etc/group下写些什么东西啊

  3. yanlong938 于 2010-08-18 00:21:36发表:

    自己做实验 了解最深。。。

  4. 相思爱文 于 2010-08-17 11:46:14发表:

    1.换行符也是一个字符,并不是空文件,建立空文件用touch命令
    2.自己建立一个题中的文件(可以在别的目录中,如/tmp),试下会有什么结果