73

I want to watch the changes of the output

gsettings list-recursively|grep text-scal

which is

org.gnome.desktop.interface text-scaling-factor 1.0  
com.canonical.Unity.Interface text-scale-factor 1.0

but if I try to watch it with

watch gsettings list-recursively|grep text-scal

I get no output, because the pipe seems to be the problem.

How can I still watch the changes?

muru
  • 207,970
rubo77
  • 34,212
  • https://unix.stackexchange.com/questions/193270/how-to-perform-the-watch-command-onto-expression-with-pipes may be helpful – rogerdpack Oct 15 '21 at 19:28

1 Answers1

113

You need to enclose the piped command in quotes as follows:

watch -n 2 'gsettings list-recursively|grep text-scal'

This will execute the command gsettings list-recursively|grep text-scal and watch it every two seconds. Note that the time interval is in seconds.

Refer to watch's manual page for more.

jobin
  • 28,667