LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-17-2006, 06:02 PM   #1
Red Squirrel
Senior Member
 
Registered: Dec 2003
Distribution: Kubuntu 20.04 on workstation, CentOS 6.x on servers
Posts: 1,206

Rep: Reputation: 49
command to monitor other command changes


Is there a command I can pipe another command through, in order to monitor and display changes? Ex: cat /var/log/maillog | [command]

So whenever the output of cat changes, it would redisplay it. (I'm guessing it would be set on a timer to keep executing the command every nn time).

This would be useful to use with commands such as sensors, uptime, etc.. when actively monitoring something.

Also is there a similar command, but specificly for files? (instead of reprinting the output, it would reprint only the new lines).


I'm pretty sure there is a command like this, just have no idea what it's called.
 
Old 07-17-2006, 10:25 PM   #2
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
Well, for something like a logfile, you can use:

tail -F /var/log/somelogfile

For a command that you want to see the results of, updated on a regular basis (for example, an ls of a directory updated at 15 second intervals):

watch -n 15 ls /somedir

The 'man tail' and 'man watch' commands will provide you with the details and additional options.
 
Old 07-19-2006, 04:22 PM   #3
Red Squirrel
Senior Member
 
Registered: Dec 2003
Distribution: Kubuntu 20.04 on workstation, CentOS 6.x on servers
Posts: 1,206

Original Poster
Rep: Reputation: 49
Quote:
Originally Posted by macemoneta
Well, for something like a logfile, you can use:

tail -F /var/log/somelogfile

For a command that you want to see the results of, updated on a regular basis (for example, an ls of a directory updated at 15 second intervals):

watch -n 15 ls /somedir

The 'man tail' and 'man watch' commands will provide you with the details and additional options.

Cool thanks, exactly what I needed. I did not know tail could do that and never even thought of checking.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
command for monitor power off Maverick1182 Linux - Newbie 2 07-08-2006 03:41 AM
Keyboard command for video out to monitor S2k4ever Solaris / OpenSolaris 4 04-16-2006 08:39 PM
help:Linux command to monitor the OS performance rajesht Linux - General 3 05-18-2005 01:15 AM
Invalid command : monitor tekn0phile Linux - Hardware 0 10-18-2003 07:04 AM
monitor power command? frimanson Linux - General 1 01-27-2002 05:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:01 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration