Operating System - HP-UX
1754017 Members
8018 Online
108811 Solutions
New Discussion юеВ

How do I tail a file and how do I stop the tail manually

 
SOLVED
Go to solution
johnnymac_1
Advisor

How do I tail a file and how do I stop the tail manually

New to HP-UX. How do I tail a file so I can montior it's entries (log file). If later I wish to stop the tail activity how do I stop the monitoring of the file manually. The file (security audits) are written to "/.secure/etc/audfile2". I can't view the files with a viewer since this file is not converted to human-readable until you save the data to a file. Thanks, John
6 REPLIES 6
Manix
Honored Contributor
Solution

Re: How do I tail a file and how do I stop the tail manually

to tail a file you need to run
tail -f /var/adm/syslog/syslog.log &
it will run in background & produce logs on console.

Other wise to just tail a file run the command without "&"

To stop the console activity just grep & kill
the tail running in background.

Thanks

Manix

HP-UX been always lovable - Mani Kalra
Hakki Aydin Ucar
Honored Contributor

Re: How do I tail a file and how do I stop the tail manually

tail -f file
To stop, Ctrl + C
Manix
Honored Contributor

Re: How do I tail a file and how do I stop the tail manually

For "auditing" files (binaries ) try audisp

You will need to use 'audisp' command to convert them into text files.


audisp > audfile.txt

You can use switches to audisp command to filter out the users, events, calls etc.,

HP-UX been always lovable - Mani Kalra
Jose Mosquera
Honored Contributor

Re: How do I tail a file and how do I stop the tail manually

Hi,

Look at the mnpage of audsys:
#man audsys

I would suggest you create a separate filesystem for /.secure as it can grow quite large and you wouldn't want to fill your root file system.

Rgds.
Mohammad Sanaullah
Frequent Advisor

Re: How do I tail a file and how do I stop the tail manually

Hi John
To tail a file and view the recent updates on the file you can do
tail -f < e.g tailing the syslog file you can give following command:

tail -f /var/adm/syslog/syslog.log, and it will periodically show the update tails of that file without closing it, to close the tail you can simply do a .

For further details and options see manual
#man tail
Alive
johnnymac_1
Advisor

Re: How do I tail a file and how do I stop the tail manually

I have found all of the response below to be of great help. A Millions thanks for all your contributions to my question. I'm very greatful for any and all support this site and it's contributors provide.

Johnny Mac.