免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2922 | 回复: 1
打印 上一主题 下一主题

[Solaris] 看看执行prtvtoc发生了什么! [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2003-04-03 16:48 |只看该作者 |倒序浏览
prtvtoc 原本的输出是这样的:
# prtvtoc /dev/dsk/c0t0d0s0
* /dev/dsk/c0t0d0s0 partition map
*
* Dimensions:
*     512 bytes/sector
*     135 sectors/track
*      16 tracks/cylinder
*    2160 sectors/cylinder
*    3882 cylinders
*    3880 accessible cylinders
*
* Flags:
*   1: unmountable
*  10: read-only
*
* Unallocated space:
*       First     Sector    Last
*       Sector     Count    Sector
*     8346240     34560   8380799
*
*                          First     Sector    Last
* Partition  Tag  Flags    Sector     Count    Sector  Mount Directory
       0      2    00          0   4609440   4609439   /
       1      3    01    4609440   2097360   6706799
       2      5    00          0   8380800   8380799
       3      7    00    6706800   1639440   8346239   /var

我想试一试用grep去掉带 \"*\" 的行,用命令:
# prtvtoc /dev/dsk/c0t0d0s0 |grep -v *
结果就。。。。。。。。。。。:

# prtvtoc /dev/dsk/c0t0d0s0 |grep -v *
bin:KÂ
      .
       ..KÃ
           cachefspackKÄ
                        cachefsstatKÅ
                                     dfKpassmgmtKÇpwconvKÈremshKÉrmailYsparcv7KstrcleanKËstrerrKÌsyncKÍ
                                                      

乱啦!!!!

这是为什么呢? 困惑。。。。。。

论坛徽章:
0
2 [报告]
发表于 2003-04-04 10:03 |只看该作者
Man grep

The grep utility searches  text  files  for  a  pattern  and
prints  all lines that contain that pattern.  It uses a com-
pact non-deterministic algorithm.

Be careful using the characters $, *, [, ^, |, (, ),  and  \\
in  the pattern_list because they are also meaningful to the
shell. It is safest to enclose the  entire  pattern_list  in
single quotes  \'... \'.

So you should use  # prtvtoc /dev/dsk/c0t0d0s0 | grep -v \'*\'
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP