Questions tagged [watch]

14 questions
30
votes
13 answers

Is there a paging version of `watch`?

Under a UNIX shell, how can I get a similar effect to the watch command, but with paging so that I can scroll around in the output if it takes up more than one screen? In other words, I want a program that is to watch what less is to cat. As an…
David Dean
  • 441
  • 6
  • 11
12
votes
4 answers

How to watch for count of new lines in tail

I want to do something like this: watch tail -f | wc -l #=> 43 #=> 56 #=> 61 #=> 44 #=> ... It counts new lines of tail each second / Linux, CentOs To be more clear. I have got something like this: tail -f /var/log/my_process/*.log | grep error I…
fl00r
  • 565
  • 2
  • 6
  • 20
11
votes
5 answers

less with "update file" like functionality

I want to watch a file that gets overwritten every 5 minutes with less. How can I make less follow the new file descriptor instead of keeping the old one displayed? watch "cat file" won't do it because the file is too long to fit into one terminal…
d135-1r43
  • 411
  • 4
  • 13
5
votes
2 answers

GNU watch - how do I make it read my environment (aliases, functions, etc)

This one has been bugging me for a while: I want to use the marvelous GNU watch command to run a few custom aliases and functions that are defined in my .bashrc, but it is never able to run anything except bash built-ins or binaries. watch -d…
Artem Russakovskii
  • 973
  • 3
  • 11
  • 25
4
votes
1 answer

How to Add color support to watch command

as the title says, I want to see colors in my watch command. ex: # enable colors when running javascript unittests with watch watch mocha # enable colors when doing `ls` watch ls -aG
Mike Graf
  • 397
  • 1
  • 3
  • 14
2
votes
1 answer

Watching a file and sending an email when it changes

I have a log file that occasionally has critical errors. Each time a critical error occurs, I'd like to have an email sent to myself notifying me of the change. Is there a unix tool / set of unix tools I can adapt for this purpose? What I thought…
bsdfish
  • 123
  • 4
1
vote
2 answers

Are the "procps" utilities available in a weird name/path on common AIX?

I have to deal with a very poorly loaded out AIX system for a development project. One thing I find missing are utilities common to Linux systems, such as those in the procps collection. Is there a convention on AIX for names or paths under which…
Phil Miller
  • 1,725
  • 1
  • 11
  • 17
1
vote
1 answer

WATCH command with pipes

Hithere, how do I watch this command: netstat -plan|grep :80|egrep -v "(:8082)|(:8080)|(:8081)"|awk {'print $5'}|cut -d: -f 1|sort|uniq -c|sort -n It errors out when surrounding it with single/double quotes.
w00t
  • 1,134
  • 3
  • 16
  • 35
1
vote
4 answers

Count amount of new lines with interval in log

Is there a way/tool to tail or watch a logfile and report the amount of lines it grows? E.g. I want to see the amount of new entries in mysql.log every 3 seconds. watch wc -l /path/to/log.log1 shows only acumulated amount. I'd prefer not to…
berkes
  • 1,975
  • 3
  • 15
  • 18
1
vote
1 answer

Help automating updating of aliases for sendmail

Currently I have a crontab entry that does the following: #!/bin/bash /etc/init.d/sendmail stop /etc/init.d/sendmail start /usr/bin/newaliases In the category of "learn something new every day", I just came across watch…
warren
  • 17,829
  • 23
  • 82
  • 134
0
votes
0 answers

Alert when a daemon stops writing in log file after some seconds

I need to send an alert if one daemon (linux) stops writing in his log file. This dameon not work properly and it not write any when shutdown. I am using an inotify for watch this problem. I see this: inotifywait -e modify -t 10…
abkrim
  • 407
  • 6
  • 18
0
votes
1 answer

Daemon for watching local file changes, uploading to FTP on change

Running Ubuntu 13.10, editing files locally. Staging server is online. No git or anything - I just need to edit a file locally, save it, upload it, and see what it does on the server. Looking for a directory watcher that will detect a file was…
ezuk
  • 313
  • 2
  • 4
  • 10
0
votes
4 answers

Using watch to run a shell script - but the script goes defunct

So I want to keep an eye on my network connectivity so I can make a report for my ISP. (seems like the modem goes out for about 30-60 seconds about once a day) So I copied this handy little…
Slashterix
  • 612
  • 1
  • 5
  • 19
0
votes
2 answers

Utility to monitor command output changes

Please, suggest native (from standard repositories) Ubuntu utility, similar to topless from ports in FreeBSD.
mcmlxxxiii
  • 105
  • 3