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

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

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

    zhyiwww
    用平實的筆,記錄編程路上的點點滴滴………
    posts - 536,comments - 394,trackbacks - 0

    注意參數-n

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

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

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

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

    我的測試:

    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:~$?


    下面的部分來自網上,對于上面的理解會更充分:
    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'





    |----------------------------------------------------------------------------------------|
                               版權聲明  版權所有 @zhyiwww
                引用請注明來源 http://m.tkk7.com/zhyiwww   
    |----------------------------------------------------------------------------------------|
    posted on 2009-07-22 11:19 zhyiwww 閱讀(12669) 評論(0)  編輯  收藏 所屬分類: linux
    主站蜘蛛池模板: 久久夜色精品国产亚洲av| 无码日韩人妻AV一区免费l| 高清永久免费观看| 免费成人在线观看| 亚洲Av永久无码精品一区二区| 日韩一区二区a片免费观看| 亚洲成人在线免费观看| 亚欧色视频在线观看免费| 亚洲成综合人影院在院播放| 久久精品一本到99热免费| 久久亚洲sm情趣捆绑调教| 免费观看无遮挡www的小视频| 亚洲欧洲日韩综合| 西西大胆无码视频免费| 亚洲欧洲无码AV不卡在线| 成人免费无码精品国产电影| 国产精品亚洲综合网站| 亚洲精品无码专区久久同性男| a免费毛片在线播放| 亚洲av无码乱码国产精品fc2| 99久久久国产精品免费牛牛| 亚洲精品在线电影| 天堂在线免费观看中文版| 亚洲s码欧洲m码吹潮| 亚洲男女内射在线播放| 在线看片免费人成视频久网下载| 亚洲电影中文字幕| 亚洲高清中文字幕免费| 美女尿口扒开图片免费| 久久久久久久亚洲精品| 99精品视频在线免费观看| 亚洲综合在线一区二区三区| 美女被免费视频网站a国产| 三级毛片在线免费观看| 亚洲国产精品成人综合色在线婷婷| 国内自产拍自a免费毛片| a级毛片高清免费视频| 亚洲人成网站看在线播放| 亚洲成a人片在线观看老师| 在线观看特色大片免费网站| 亚洲一级特黄特黄的大片|