Use of watch and lsof + grep together

599 Views Asked by At

When i use

lsof -p 3536693 | grep snapshot

I get an output

but if i try to

watch lsof -p 3536693 | grep snapshot

I get nothing. Aren't they compatible?

It works if I ommit grep, like

watch lsof -p 3536693
1

There are 1 best solutions below

0
CrazyRabbit On BEST ANSWER

It works when the "watched" command is quoted, so:

watch "lsof -p 3536693 | grep snapshot"