• Finding the Tail
  • L in u X ba sics for h acke rs g e t t I n g s t a r t e d w I t h




    Download 7,3 Mb.
    Pdf ko'rish
    bet42/125
    Sana14.05.2024
    Hajmi7,3 Mb.
    #232858
    1   ...   38   39   40   41   42   43   44   45   ...   125
    Bog'liq
    linuxbasicsforhackers

    Finding the Head
    If you just want to view the beginning of a file, you can use the 
    head
    com-
    mand. By default, this command displays the first 10 lines of a file. The 
    following command, for instance, shows you the first 10 lines of snort.conf:
    kali >
    head /etc/snort/snort.conf
    #-------------------------------------------------
    # VRT Rule Packages Snort.conf
    #
    # For more information visit us at:
    --
    snip
    --
    # Snort bugs:bugs@snort.org
    If you want to see more or fewer than the default 10 lines, enter the 
    quantity you want with the dash (
    -
    ) switch after the call to 
    head
    and before 
    the filename. For example, if you want to see the first 20 lines of the file, 
    you would enter the command shown at the top of Listing 2-2.


    Text Manipulation
    21
    kali >
    head -20 /etc/snort/snort.conf
    #-------------------------------------------------
    # VRT Rule Packages Snort.conf
    #
    # For more information visit us at:
    --
    snip
    --
    # Options : --enable-gre --enable-mpls --enable-targetbased
    --enable-ppm --enable-perfprofiling enable-zlib --enable-act
    live-response --enable-normalizer --enable-reload --enable-react
    Listing 2-2: Displaying the first 20 lines of 
    snort.conf
     in the terminal window
    You should see only the first 20 lines of snort.conf displayed in your 
    terminal window.
    Finding the Tail
    The 
    tail
    command is similar to the 
    head
    command, but it’s used to view the 
    last lines of a file. Let’s use it on snort.conf:
    kali >
    tail /etc/snort/snort.conf
    #include $SO_RULE_PATH/smtp.rules
    #include $SO_RULE_PATH/specific-threats.rules
    #include $SO_RULE_PATH/web-activex.rules
    #include $SO_RULE_PATH/web-client.rules
    #include $SO_RULE_PATH/web-iis.rules
    #include $SO_RULE_PATH/web-miscp.rules
    #Event thresholding and suppression commands. See threshold.conf
    Notice that this command displays some of the last 
    include
    lines of the 
    rules files, but not all of them, because similar to 
    head
    , the default for 
    tail
    is to show 10 lines. You can display more lines by grabbing the last 20 lines 
    of snort.conf. As with the 
    head
    command, you can tell 
    tail
    how many lines 
    to display by entering a dash (
    -
    ) and then the number of lines between the 
    command and the filename, as shown in Listing 2-3.
    kali >

    Download 7,3 Mb.
    1   ...   38   39   40   41   42   43   44   45   ...   125




    Download 7,3 Mb.
    Pdf ko'rish

    Bosh sahifa
    Aloqalar

        Bosh sahifa



    L in u X ba sics for h acke rs g e t t I n g s t a r t e d w I t h

    Download 7,3 Mb.
    Pdf ko'rish