Basic Commands in Linux - WATCH

watch
   watch command is used to see the output of particular command frequently and displays the output.
Consider you want to see whether a file in a particular folder was Processed or not. To check this we frequently use ls command or find command to check the file. Instead, we can use watch command for these scenarios

watch ls -l - this will run the ls -l command for every 2 seconds and display the output like below.







if you want to change the time interval we can use watch -n (sec) command.

for example: watch -n 3 ls -l this will run the command for every 3 sec

to go back to terminal use ctrl+c.

Comments

Popular posts from this blog

Basic Commands in Linux - To display list of files and folders in a directory or folder

Basic Commands in Linux - To display Date And Time

Basic Commands in Linux - To create a file