<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    zhyiwww
    用平實(shí)的筆,記錄編程路上的點(diǎn)點(diǎn)滴滴………
    posts - 536,comments - 394,trackbacks - 0

    注意參數(shù)-n

    (1)顯示某一行或某些行

    顯示1,10行
    $ sed -n '1,10p' postgres.conf

    顯示第10行
    $ sed -n '10p' postgres.conf

    (2)顯示某些匹配行
    $ sed -n '/This/p' postgres.conf

    我的測(cè)試:

    XYZ@XYZ-desktop:~$ sed -n '1,10 p' postgresql.conf??
    # -----------------------------
    # PostgreSQL configuration file
    # -----------------------------
    #
    # This file consists of lines of the form:
    #
    #?? name = value
    #
    # (The "=" is optional.)? Whitespace may be used.? Comments are introduced with
    # "#" anywhere on a line.? The complete list of parameter names and allowed
    XYZ@XYZ-desktop:~$ sed -n '10p' postgresql.conf?
    # "#" anywhere on a line.? The complete list of parameter names and allowed
    XYZ@XYZ-desktop:~$ sed -n '/This/p' postgresql.conf?
    # This file consists of lines of the form:
    # This file is read on server startup and when the server receives a SIGHUP
    # This is used when logging to stderr:
    XYZ@XYZ-desktop:~$?


    下面的部分來自網(wǎng)上,對(duì)于上面的理解會(huì)更充分:
    Relations between d, p, and !
    Sed Range Command Results
    --------------------------------------------------------
    sed -n 1,10 p Print first 10 lines
    sed -n 11,$ !p Print first 10 lines
    sed 1,10 !d Print first 10 lines
    sed 11,$ d Print first 10 lines
    --------------------------------------------------------
    sed -n 1,10 !p Print last 10 lines
    sed -n 11,$ p Print last 10 lines
    sed 1,10 d Print last 10 lines
    sed 11,$ !d Print last 10 lines
    --------------------------------------------------------
    sed -n 1,10 d Nothing printed
    sed -n 1,10 !d Nothing printed
    sed -n 11,$ d Nothing printed
    sed -n 11,$ !d Nothing printed
    --------------------------------------------------------
    sed 1,10 p Print first 10 lines twice,
    Then next 10 lines once
    sed 11,$ !p Print first 10 lines twice,
    Then last 10 lines once
    --------------------------------------------------------
    sed 1,10 !p Print first 10 lines once,
    Then last 10 lines twice
    sed 11,$ p Print first 10 lines once,
    then last 10 lines twice

    This table shows that the following commands are identical:

    sed -n '1,10 p'
    sed -n '11,$ !p'
    sed '1,10 !d'
    sed '11,$ d'





    |----------------------------------------------------------------------------------------|
                               版權(quán)聲明  版權(quán)所有 @zhyiwww
                引用請(qǐng)注明來源 http://m.tkk7.com/zhyiwww   
    |----------------------------------------------------------------------------------------|
    posted on 2009-07-22 11:19 zhyiwww 閱讀(12669) 評(píng)論(0)  編輯  收藏 所屬分類: linux
    主站蜘蛛池模板: 国产成人高清亚洲一区91| 国产免费伦精品一区二区三区| 免费国产真实迷j在线观看| 亚洲免费日韩无码系列| 亚洲酒色1314狠狠做| 曰皮全部过程视频免费国产30分钟| 一级特级aaaa毛片免费观看| 亚洲综合色一区二区三区小说| 国产精品国产免费无码专区不卡| 中文字幕无码毛片免费看| 亚洲一区二区三区91| 亚洲欧洲精品成人久久曰影片| 在线成人爽a毛片免费软件| 日本亚洲中午字幕乱码| 亚洲人成电影福利在线播放 | 亚洲国产成人精品女人久久久 | 国产午夜精品免费一区二区三区 | 日韩免费高清一级毛片| 99久久亚洲综合精品成人网| 国产hs免费高清在线观看| 18女人毛片水真多免费| 一级毛片在线免费播放| 亚洲人成图片网站| 亚洲AV无码成人精品区天堂| 国产免费观看网站| 免费精品国产自产拍在线观看图片 | 亚洲一区综合在线播放| 可以免费观看的一级毛片| 国产精品视频免费| av永久免费网站在线观看| 亚洲av无码专区国产不乱码| 亚洲精品日韩专区silk| 亚洲桃色AV无码| 国产免费黄色大片| 色妞WWW精品免费视频| 久久精品国产这里是免费| fc2免费人成在线视频| 亚洲AV永久无码精品网站在线观看 | 亚洲国产精品尤物yw在线| 在线观看免费污视频| 免费能直接在线观看黄的视频 |