Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Linux watch Command Syntax
#1

    Linux watch Command Syntax
   

Linux watch Command Syntax


   

The watch command syntax looks like this:


   
watch [options]

   

For example, a watch command combined with the free command would look like this:

    Example watch command

   

The specified command shows that the watch command clears the terminal window and runs the free command every two seconds. You can find the list of most commonly used watch command options below:


                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
OptionExplanation
-d, --differencesDisplays the differences between watch command updates. If you want all changed values to stay highlighted, use the combined -d=cumulative option.
-t, --no-titleTurns off the header that displays the time interval, command, current time and date, and hostname.
-n, --intervalAllows users to specify the time interval between output updates in seconds.
-b, --beepPlays a beep whenever a command exits with an error.
-g, --chgexitExits the watch command when the user command output changes.
-e, --errexitHalts watch command updates on screen when an error occurs and exits the command after a key press.
-h, --helpDisplays the help page.
-c, --colorInterprets ANSI color and style sequences.
-x, --execForwards user command to exec.
-p, --preciseTries to run the user-defined command exactly after seconds defined by the --interval option.
   

   
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)