Questions tagged [watch]

watch - execute a program periodically, showing output fullscreen

Filter by
Sorted by
Tagged with
0 votes
0 answers
83 views

Simplify NETSTAT monitoring output

I'm monitoring suspicious incoming connections using sudo watch -n 30 "netstat -antp" which provides more information than I need, so based on the answer I found here, I've tried to ...
marcusdavanco's user avatar
0 votes
1 answer
698 views

How can I watch a folder on an sftp server for new files?

I log in to a sftp server, and to see the files I type ls. Is there any way to recursively watch a folder? For now I just keep typing ls -tlh. Is there a way for that to happen without me typing it? ...
Hcabnettek's user avatar
1 vote
0 answers
150 views

Utilize `fswatch` to improve `rsync`'s speed?

I have some huge folders containing about 40000 files (and much, much more gitignored files like node_modules), and I want to rsync to a remote machine. Currently, I use a simple script like run_rsync;...
ch271828n's user avatar
  • 123
0 votes
1 answer
809 views

watch --color doesn't work when a pipe is involved?

The following demonstrates that watch works with color, but not when a pipe is involved. $ touch test.txt $ ls | grep --color test.txt test.txt # This IS colored ...
davidparks21's user avatar
  • 1,572
-2 votes
2 answers
1k views

BSOD Clock watchdog timeout Windows 10

ISSUE OS: Windows 10 Enterprise. HARDWARE: MSI X370 SLI PLUS, Ryzen 1600, 32GB DDR4 2133, 250G SSD, 850W TT Gold PSU and Gigabyte RX580 8GB ISSUE DESCRIPTION: Fresh install, OS works, installed ...
JRR's user avatar
  • 21
1 vote
1 answer
960 views

Watch + pipe + multiple arguments

I have a command diff -y <(xxd FILE) <(xxd FILE_) | colordiff and i want to put it into watch routine. Something like that: watch -n 0,1 'diff -y <(xxd FILE) <(xxd FILE_)' But i have an ...
Kirill's user avatar
  • 13
2 votes
1 answer
3k views

Using watch command with "echo -e"

I want to monitor rows of a dynamic file and I use watch command for this. I have 2 files: test-status and iplist_test. I control something in iplist_test and I type this output to test-status. ...
Jo Shepherd's user avatar
2 votes
1 answer
52 views

Separating files in watch command

I have 3 files and I want watch the changes of these files with 'watch' command. But these 3 files have a lot of row and I just want see the last 3 rows with 'tail'. There is no problem at here. I can ...
Jo Shepherd's user avatar
0 votes
1 answer
397 views

Integrating "watch" with "top" logging until finished - HOW?

I stumbled across this link: "watch" the output of a command until a particular string is observed and then exit I know the PID of the process. I want to log the process "resource-...
mshaffer's user avatar
  • 103
0 votes
0 answers
110 views

Watch folder and rename file extension

Good day, I'm trying to find a way to watch a folder, and as soon as it see's an xml file/s, it will change it's extension to .txt I am trying to do this in powershell, hope this question find you ...
Leo's user avatar
  • 13
3 votes
1 answer
135 views

Is there a Unix command to record changes to output of another command?

I have a long running operation that affects some state. That state is shown by running a certain command, say showst. I want to see have a log of all the possible outputs showst will display during ...
Illia Bobyr's user avatar
4 votes
1 answer
4k views

How do I live monitor on linux what files get accessed created modified and deleted?

How do I monitor from this moment on what files get accessed / modified / created / deleted. (in live mode), similar to fseventer / fslogger?
user1861388's user avatar
8 votes
2 answers
8k views

Watch with awk command

How do you watch a command like? awk 'NR%2==0 {printf "%s %8.0f", $1, $5}' filename.txt Preceding this with "watch" gives this error: awk: cmd. line:1: fatal: cannot open file `{printf' for reading ...
user1271772's user avatar
1 vote
1 answer
2k views

Detecting new USB devices with bash?

I'm writing a bash script that needs to detect when a usb storage device is inserted and assign it to a variable that would otherwise, typically look something like: usb=/dev/sdb. I have a few ...
voices's user avatar
  • 2,651
29 votes
3 answers
12k views

How do I get systemctl to print in color when being interacted with from a non-tty?

When I run a command like this: # systemctl status plexmediaserver I get nicely colored output. But when I run the following command: # watch -n300 --color systemctl status plexmediaserver Is ...
cronburg's user avatar
  • 696
0 votes
1 answer
58 views

Using "watch" to detect difference in value and write to a file

I am trying to catch the cause of an intermittent %CPU spike in a server with the command: watch -n .5 "ps aux | sort -rk 3,3 | head -n 2" where it displays the process with the highest %CPU every .5 ...
user305131's user avatar
2 votes
1 answer
554 views

Preserve colors with watch -n

I am running watch tail -n 15 20151217.log and my output looks like 12-17 04:42:52 DEBUG [31mXYZT 10 91.5[0m Instead, I want to see it as colored text. What can I do? I don't want to use ...
The Baron's user avatar
  • 121
1 vote
2 answers
767 views

"awk" not working when using it with "watch"

In order to watch my IPv6 traffic totals I want to run this command: netstat -s -6 | grep -i octet | grep -vi cast | awk '{ print $2/(1024*1024*1024) }' combined with "watch -n1", so it gets run ...
M. Schmidt's user avatar
4 votes
1 answer
628 views

Function using watch on command with command line arguments

I want to run watch on a command which uses an optional command line argument, like this: function queue() { watch -n 10 'squeue -p ${1:-default} -o "%.8i" ' } but the command-line argument isn'...
DilithiumMatrix's user avatar
0 votes
2 answers
91 views

Copy file on file change in Windows 8.1

I would like to set up a rule in Windows 8.1 to copy a certain file to another location whenever it changes. How can I accomplish this?
Fredrik P's user avatar
  • 177
0 votes
2 answers
87 views

Combine the results of a CAT and TAC in a single window in Linux

I have two log files which I would like to view on my screen simultaneously. Below you can see my commands: pi@raspberrypi ~ $ watch -n 1 tac /home/pi/log/log.txt pi@raspberrypi ~ $ watch -n 1 cat /...
user avatar
0 votes
1 answer
1k views

Any apps that auto sync local to remote on save for mac?

Does Panic's Transmit has this feature? For example you set it to watch a particular folder, and any file changes in that folder gets uploaded to the remote automatically? They were highly ...
resting's user avatar
  • 921
1 vote
1 answer
215 views

Show last 5 opened processes in terminal?

I am trying to have a terminal showing the last 5 processes opened. This is helpful for my debugging. At this point I have watch ps -ef --sort=start_time This works fine but it shows all processes ...
Pithikos's user avatar
  • 1,574
2 votes
1 answer
1k views

watch mysql output w/ tabular columns

how come when I run a mysql query and dump the results to stdout I get a pretty printed table ie: > mysql -e "describe <table>" <database> +------------+--------------+------+-----+----...
veilig's user avatar
  • 961
0 votes
3 answers
971 views

Linux watch command: "--differences" not working

I would like to use the linux watch command and have seen that there may be a "culmulative" (--differences=) parameter but this doesnt appear to be working. Basically I would like to do the following ...
user avatar
4 votes
2 answers
5k views

Continuously check netstat output for a particular program

I have a android emulator running on port 5554. I want to continuously watch the netstat output concerning emulator stuff. Right now I have to manually execute this command every time sudo netstat -...
Vihaan Verma's user avatar
9 votes
4 answers
7k views

How do I use the watch and jobs commands together in Bash?

How do I use the watch command with jobs command, so that I can monitor when a background job is finished? I execute it as follows, but I do not get the output from jobs: watch jobs If I run jobs ...
dabest1's user avatar
  • 992
5 votes
4 answers
2k views

Is there a linux command that lets me color-code the result of another command?

I'm running a watch on a command to monitor the number of open connections for a service we're diagnosing. I need to keep an eye on it while doing other work, to help other developers identify when ...
STW's user avatar
  • 1,836
2 votes
2 answers
2k views

Run two watch commands simultaneously

I want to run two executables in the foreground by typing one line of code or running a shell script. These executables watch a directory and recompile some code while outputting their status to ...
vaughan's user avatar
  • 917
3 votes
1 answer
2k views

How can I get gnu watch to run in the background?

If I start a watch command in the background, it stops. Bringing the job to the foreground makes it run again, but I want this to run in the background. $ watch ./do-something.sh & [1] 97673 [1]+ ...
tobym's user avatar
  • 212
47 votes
8 answers
82k views

Store the output of date and watch command to a file

I am a newbie to linux and I am trying to watch a command and try to log it into a file. I tried watch -t -n 10 "(date '+TIME:%H:%M:%S' ; ps aux | grep "pattern" | wc -l)" >> logfile and am ...
LoudKur's user avatar
  • 613
2 votes
2 answers
1k views

Changing terminal size affects the output of grep inside a watch command

If I run a command like: watch "ps -ef | grep '^foo.*bar'" and the matching output line of ps -ef is a long line like foo <lots and lots of text here> bar whether this line is output is ...
jonderry's user avatar
  • 997
23 votes
3 answers
22k views

Using the watch command with an argument that contains quotes

I'm trying to get watch to work correct with commands that contain quotes, and the watch man page isn't very detailed about how quotes work. To give a concrete example, how can I run the following ...
jonderry's user avatar
  • 997
1 vote
1 answer
247 views

How can I fix a problem with standard error screwing up the output of watch?

Specifically, I am trying to run the following command on both CentOS and Fedora14 (same issue with both) watch sudo jmap -heap 31945 However, there are a few lines of standard error that screw up ...
jonderry's user avatar
  • 997
5 votes
1 answer
309 views

Command-line tool to measure how fast a file is growing?

Is there a command-line tool to measure how fast a text file is growing, in units of lines/second? For small-ish files, I can do something with watch and wc -l, but that measures the file anew each ...
Ken's user avatar
  • 335
224 votes
4 answers
55k views

Using watch with pipes

I'd like to run this command: watch -n 1 tail -n 200 log/site_dev.log | grep Doctrine But it does not run, because "I think" that the grep tries to run on the watch instead of the tail... Is there ...
Tommy B.'s user avatar
  • 2,589
88 votes
4 answers
37k views

bash watch command with colors preserved

From man watch: Non-printing characters are stripped from program output. Use "cat -v" as part of the command pipeline if you want to see them. So how do I use cat -v if I want to see the ...
Paweł Gościcki's user avatar
3 votes
3 answers
8k views

TV Tuner to record / show multiple channels at the same time [closed]

I need a cheap mode to record / watch multiple TV channel at the same time on a single PC. Can anyone recommend me any solution(TV Tuner, Application) that can help me solve this problem?
mxg's user avatar
  • 310
0 votes
6 answers
4k views

How to block website from reading my IP?

I want to watch videos on a website but I can only access my country's version. Whenever I type in say .ca (Canada) instead of .il (Israel), I get redirected to .il. How can I surpass that?
user avatar