tail command with sleep and number of lines - Unix

This is a discussion on tail command with sleep and number of lines - Unix ; Hi I am new bee in Unix, I want to use tail -f with sleep and number of lines, to display at a time i am using tail -f -s 20 -n 5 filename. This is displaying correct result for ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: tail command with sleep and number of lines

  1. tail command with sleep and number of lines

    Hi

    I am new bee in Unix,

    I want to use tail -f with sleep and number of lines, to display at a time

    i am using

    tail -f -s 20 -n 5 filename.
    This is displaying correct result for 1st time, but as tail -f is appending , i am not able to view 5 lines

    PLZ guide me...

  2. Re: tail command with sleep and number of lines

    You need to put it in an infinite loop and not use the -f option. Try this, using the syslog file as an example:

    while true
    do
    tail -n 5 /usr/adm/syslog
    sleep 20
    done
    --------------------------------------------
    Pat Welch, UBB Computer Services, a WCS Affiliate
    SCO Authorized Partner
    Microlite BackupEdge Certified Reseller
    Unix/Linux/Windows/Hardware Sales/Support
    (209) 745-1401 Cell: (209) 251-9120
    E-mail: patubb@inreach.com
    ---------------------------------------------

+ Reply to Thread