watch will execute a program periodically, displaying the output.

learn more… | top users | synonyms

1
vote
2answers
9 views

watch perldoc output preserving formatting

When I use watch to follow a perlpod documentation i am writing, the formatting gets mangeled (see NAME and Synopsis sections): Every 2,0s: perldoc lib/Uki/Handlers/SOS.pm ...
1
vote
1answer
82 views

Repeating a text-output terminal command, in a scrollable ncurses-like interface?

man ps says: If you want a repetitive update of the selection and the displayed information, use top(1) instead. ... however, in some cases, I don't like the output of top - I would instead like ...
1
vote
0answers
25 views

Use an alias with watch command [duplicate]

The post repeat command every x seconds shows that watch is the utility that is useful for the invoking a command at fixed interval repeatedly. Now, I have very long commands, and have used aliases ...
11
votes
2answers
211 views

Does watch only monitor the visible output?

Does watch only monitor the visible output of a command? Say I'm in a directory with the following contents: $ ls a b c d e f g h i j k l m n If I run watch -g ls -1 I expect it to ...
3
votes
1answer
93 views

watch command to delete files in a directory every N secs

I thought of using watch command to delete files in a directory every N seconds with the command running in background. This is what I was planning to use: nohup watch -n1200 rm -rf ...
0
votes
1answer
38 views

Watch goes blank on refresh [duplicate]

I'm running the following command in watch. Works for the first one but subsequent ones go blank watch diff <(pacman -Q) <(ssh kate "pacman -Q")
2
votes
3answers
149 views

Can I reload variable in a watch command?

Part of my job involves some data handling. One of the tasks is to 'flatten' a set of directories (which we'll call Dir for now), and copy them to a new location called DirFlat. This can take a long ...
1
vote
2answers
640 views

How to watch pgrep?

When running a pgrep command with watch it does not only show the actual pgrep output, but also the watch process as well. Example: watch pgrep -lf donothing will show 3 processes, although ...
3
votes
3answers
800 views

Output of 'watch' command as a list

I want to do some simple computation of the number of lines per minute added to a log file. I want also to store the count for each second. What I need is the output of the following command as a ...
2
votes
1answer
328 views

Chaining commands within `watch`

Ok, this is driving me a bit nuts. I'm trying to watch the number of files in a set of subdirectories. find . | wc -l correctly returns the number of sub-folders and files. However, watch 'find . | ...
4
votes
1answer
504 views

'watch'-ing curl yields unexpected output

I'm trying to watch curl for live feedback on HTTP tweaks. However, when I execute the command, the output is garbled with some download stats. I've tried sending curl's stderr to /dev/null, to no ...
2
votes
1answer
612 views

watch command not showing colors for 'git status'

I'm trying to get watch to display colors from 'git status'. I've tried running watch with the --color option, as suggested elsewhere here, but, still, watch --color 'git status' doesn't display ...
6
votes
4answers
2k views

Cygwin has no watch command?

I installed Cygwin on my Windows XP to use some of its commands. Now I what to check a file every 2 minutes and want to use watch for this purpose but I see that Cygwin has no such command. Is this ...
2
votes
1answer
188 views

How can I extend the wait time for the watch command beyond 4200 or so seconds?

I have encountered a limitation of the watch command. Even though I specify watch -n 14400 to run the command every 4 hours or so, the command executes every 4200 or so seconds, which is about an ...
2
votes
2answers
233 views

using watch with ssh

I have a script: export TERM=xterm watch -t -d -n 1 'netstat -veeantpo | grep 43597 when we run this script though ssh, it does not determine the monitor resolution. so lines are wrapped although ...
8
votes
2answers
998 views

Alternative to watch which support colors

I have a command (phpunit) which has a colored output. According to the watch, command I should be able to use the --color flag to allow color rendering to pass through. However, this isn't working. ...
5
votes
4answers
2k views

How can I run `watch` as a background job?

When I run: watch 'cmd >> output.txt' & the job gets suspended by the system: 3569 Stopped (tty output) Is there a workaround?
6
votes
2answers
2k views

Reading from a continuously changing logfile

There is /location/of/thefile, which is a continuously changing logfile. The average density of refreshes is 4 per minute, the possible maximal refresh rate could be 30-40 per minute. Every refresh ...
28
votes
7answers
20k views

Is there a way to dynamically refresh the less command?

I like the watch command, but it has its limitations. I'm curious to know whether I could mimic the functionality of watch with less. I'm mainly looking for the ability to scroll through my directory ...
14
votes
2answers
2k views

How can I scroll within the output of my watch command?

I use the watch command to see the contents of my directory changing as a script runs on it (via watch ls dir/) It's a great tool, except that I can't seem to scroll down or up to see all of the ...