{"id":15899,"date":"2019-03-08T09:36:32","date_gmt":"2019-03-08T09:36:32","guid":{"rendered":"https:\/\/www.hostinger.com\/tutorials\/?p=15899"},"modified":"2026-03-09T19:19:42","modified_gmt":"2026-03-09T19:19:42","slug":"linux-watch-command","status":"publish","type":"post","link":"\/ng\/tutorials\/linux-watch-command","title":{"rendered":"How to use the Linux watch command"},"content":{"rendered":"<?xml encoding=\"utf-8\" ?><p>The Linux <strong>watch<\/strong> command is a powerful tool that runs user-defined commands at regular intervals and displays the output. It&rsquo;s important for monitoring processes and system resources in real time without manually re-running commands.<\/p><p>Whether you&rsquo;re tracking disk usage, monitoring network interfaces, or observing file and directory changes, <strong>watch<\/strong> helps streamline these tasks.<\/p><p>In this guide, you&rsquo;ll learn how to use the <strong>watch<\/strong> command, from its basic syntax and options to practical examples. By the end, you&rsquo;ll be able to efficiently monitor various system activities through the command line.<\/p><div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"https:\/\/assets.hostinger.com\/content\/tutorials\/pdf\/Linux-Commands-Cheat-Sheet.pdf\"><img loading=\"lazy\" decoding=\"async\" width=\"2048\" height=\"566\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/11\/Linux-cheat-sheet.png\/public\" alt=\"\" class=\"wp-image-69262\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/11\/Linux-cheat-sheet.png\/w=2048,fit=scale-down 2048w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/11\/Linux-cheat-sheet.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/11\/Linux-cheat-sheet.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/11\/Linux-cheat-sheet.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/11\/Linux-cheat-sheet.png\/w=768,fit=scale-down 768w\" sizes=\"auto, (max-width: 2048px) 100vw, 2048px\" \/><\/a><\/figure><\/div><p>\n\n\n\n<\/p><h2 class=\"wp-block-heading\" id=\"h-prerequisites\">Prerequisites<\/h2><p>To use the <strong>watch<\/strong> command, you must access your <a href=\"\/ng\/tutorials\/what-is-vps-hosting\">Linux virtual private server (VPS)<\/a> or computer using an account with <strong>sudo<\/strong> privileges. If you don&rsquo;t have this permission, grant the<strong> sudo <\/strong>access by <a href=\"\/ng\/tutorials\/sudo-and-the-sudoers-file\">editing the sudoers file<\/a> as <strong>root<\/strong>.<\/p><p>If you use a remote system, open its command-line interface (CLI) using Terminal or an <a href=\"\/ng\/tutorials\/how-to-use-putty-ssh\">SSH client application like PuTTY<\/a>. For desktops, you can open it by pressing <strong>Ctrl <\/strong>+ <strong>Alt<\/strong> + <strong>T<\/strong>.<\/p><p>Alternatively, Hostinger VPS users can access their remote server&rsquo;s CLI via a web browser using the<strong> Browser terminal<\/strong> feature.<\/p><?xml encoding=\"utf-8\" ?><figure class=\"wp-block-image size-large\"><a class=\"hgr-tutorials-cta hgr-tutorials-cta-vps-hosting\" href=\"\/ng\/vps-hosting\" target=\"_blank\" rel=\"noreferrer noopener\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"300\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/02\/VPS-hosting-banner.png\/public\" alt=\"\" class=\"wp-image-77934\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/02\/VPS-hosting-banner.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/02\/VPS-hosting-banner.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/02\/VPS-hosting-banner.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/02\/VPS-hosting-banner.png\/w=768,fit=scale-down 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><h2 class=\"wp-block-heading\" id=\"h-the-linux-watch-command-syntax\">The Linux watch command syntax<\/h2><p>The <strong>watch<\/strong> command uses a simple structure, making it easy to set. Here&rsquo;s its basic syntax:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">watch [options] command<\/pre><ul class=\"wp-block-list\">\n<li><strong>watch<\/strong>. The main command that will repeat a specified command multiple times at regular intervals.<\/li>\n\n\n\n<li><strong>[options]<\/strong>. Optional flags to modify the <strong>watch<\/strong> command&rsquo;s behavior, such as adjusting the interval or highlighting changes.<\/li>\n\n\n\n<li><strong>command<\/strong>. The actual <a href=\"\/ng\/tutorials\/linux-commands\">Linux command<\/a> you want to monitor. It can be any command that outputs data to the terminal, such as disk usage, network statistics, or system resources.<\/li>\n<\/ul><p>When executed, the specified command will continuously refresh its output based on the interval you set. To stop the process, press <strong>Ctrl + C<\/strong>.<\/p><h3 class=\"wp-block-heading\" id=\"h-the-watch-command-options\">The watch command options<\/h3><p>The <strong>watch<\/strong> command offers several options to enhance its functionality. Below are some of the most common ones:<\/p><ul class=\"wp-block-list\">\n<li><strong>-b<\/strong>. Plays a beep sound when the command exits with a non-zero status, indicating an error.<\/li>\n\n\n\n<li><strong>-c<\/strong>. Enables ANSI color highlighting in the output.<\/li>\n\n\n\n<li><strong>-d<\/strong>. Highlights differences between successive updates, making it easier to spot changes.<\/li>\n\n\n\n<li><strong>-e<\/strong>. Evaluates exit status. If <strong>watch<\/strong> encounters a command error, it will freeze and quit on a key press.<\/li>\n\n\n\n<li><strong>-g<\/strong>. Exits the <strong>watch<\/strong> command when the command&rsquo;s output changes.<\/li>\n\n\n\n<li><strong>-h<\/strong>. Shows help information for the <strong>watch<\/strong> command.<\/li>\n\n\n\n<li><strong>-n [number]<\/strong>. Sets the interval between updates in seconds. The default value is <strong>2<\/strong>.<\/li>\n\n\n\n<li><strong>-p<\/strong>. Makes the <strong>watch<\/strong> command beep if any output changes.<\/li>\n\n\n\n<li><strong>-t<\/strong>. Turns off the header showing the command, update interval, and current time.<\/li>\n\n\n\n<li><strong>-w<\/strong>. Toggles line wrapping to truncate long outputs.<\/li>\n\n\n\n<li><strong>-x<\/strong>. Executes the command in a shell, allowing you to use more complex commands.<\/li>\n\n\n\n<li><strong>&ndash;precise<\/strong>. Ensures the interval between updates is consistent by minimizing potential delays.<\/li>\n<\/ul><h2 class=\"wp-block-heading\" id=\"h-examples-of-the-linux-watch-command\">Examples of the Linux watch command<\/h2><p>Now that we&rsquo;ve discussed the syntax and options, it&rsquo;s time to look at some real-life <strong>watch<\/strong> command examples.<\/p><h3 class=\"wp-block-heading\" id=\"h-monitoring-system-resources\">Monitoring system resources<\/h3><p>One common use of the <strong>watch<\/strong> command is for real-time system monitoring. This can help track CPU usage, memory consumption, and other key metrics to ensure your Linux system is running smoothly.<\/p><p>To monitor CPU and memory usage, combine <strong>watch<\/strong> with the <strong>top<\/strong> command as shown in the following example:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">watch -n 5 top -b -n 1<\/pre><p>This <strong>watch<\/strong> command updates the system resource usage every <strong>five<\/strong> seconds. Here&rsquo;s the expected output:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">top - 15:32:18 up 1:25,  1 user,  load average: 0.16, 0.10, 0.09\nTasks: 203 total,   1 running, 202 sleeping,   0 stopped,   0 zombie\n%Cpu(s):  1.7 us,  0.2 sy,  0.0 ni, 98.0 id,  0.0 wa,  0.0 hi,  0.1 si,  0.0 st\nMiB Mem :  7977.6 total,  5728.2 free,   766.3 used,  1483.1 buff\/cache\nMiB Swap:  2048.0 total,  2048.0 free,     0.0 used.  6744.5 avail Mem<\/pre><h3 class=\"wp-block-heading\" id=\"h-tracking-directory-changes\">Tracking directory changes<\/h3><p>You can also use <strong>watch<\/strong> to monitor changes in a directory over time. This is particularly helpful for tracking file modifications, additions, or deletions. Combine it with the <strong>ls<\/strong> command to track the directory, for instance:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">watch -n 10 ls -lh \/path\/to\/directory<\/pre><p><strong>watch<\/strong> will update the directory listing every <strong>10<\/strong> seconds, so you can see changes as they happen. The command output is as follows:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">total 20K\n-rw-r--r-- 1 user user 1.2K Sep 20 14:32 file1.txt\n-rw-r--r-- 1 user user 600 Sep 20 14:34 file2.txt\ndrwxr-xr-x 2 user user 4.0K Sep 20 14:35 folder1<\/pre><h3 class=\"wp-block-heading\" id=\"h-monitoring-disk-usage\">Monitoring disk usage<\/h3><p>Monitoring your Linux system&rsquo;s disk usage is important to help you detect issues and unused files that can deplete storage space. By using the <strong>watch<\/strong> command with <strong>df -h<\/strong>, you can periodically monitor how much disk space is currently used.<\/p><p>To <a href=\"\/ng\/tutorials\/vps\/how-to-check-and-manage-disk-space-via-terminal\">monitor disk usage<\/a>, run the following:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">watch -n 15 df -h<\/pre><p>The output will display something like this:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">Filesystem Size Used Avail Use% Mounted on\n\/dev\/sda1 50G 20G 28G 42% \/\n\/dev\/sdb1 100G 60G 35G 64% \/mnt\/data\ntmpfs 1.9G 1.0M 1.9G 1% \/dev\/shm<\/pre><h3 class=\"wp-block-heading\" id=\"h-checking-network-interfaces\">Checking network interfaces<\/h3><p>Monitoring network interfaces helps track bandwidth usage and identify potential network issues. You can combine <strong>watch<\/strong> with either <strong>ifconfig<\/strong> or <strong>ip -s link<\/strong> to observe real-time network activity changes and detect anomalies.<\/p><p>Here&rsquo;s an example of checking network interface status using <strong>watch<\/strong> and <strong>ip -s link<\/strong>:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">watch -n 5 ip -s link<\/pre><p>After running the command, you should see the output below every <strong>five<\/strong> seconds:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">1: lo: &lt;LOOPBACK,UP,LOWER_UP&gt; mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000\n    RX: bytes  packets  errors  dropped overrun mcast   \n         123456  789    0       0       0       0       \n    TX: bytes  packets  errors  dropped carrier collsns \n         654321  432    0       0       0       0       \n2: eth0: &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000\n    RX: bytes  packets  errors  dropped overrun mcast   \n         987654  4321   0       0       0       0       \n    TX: bytes  packets  errors  dropped carrier collsns \n         123456  5678   0       0       0       0       <\/pre><h3 class=\"wp-block-heading\" id=\"h-observing-log-files\">Observing log files<\/h3><p>Using<strong> watch<\/strong> with the <a href=\"\/ng\/tutorials\/how-to-use-tail-command\">tail command<\/a> lets you observe real-time changes in log files as they add new entries. This is handy when troubleshooting system issues or tracking specific events without manually reopening or refreshing the file.<\/p><p>To observe the updates to a log file, run the following command:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">watch -n 20 tail -n 20 \/var\/log\/syslog<\/pre><p>This command will display the last 20 lines of the system log file every 20 seconds:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">Sep 20 12:35:01 server CRON[12345]: (root) CMD (run-parts \/etc\/cron.hourly)\nSep 20 12:40:01 server CRON[12346]: (root) CMD (run-parts \/etc\/cron.daily)\nSep 20 12:45:01 server systemd[1]: Starting Cleanup of Temporary Directories...\nSep 20 12:50:01 server systemd[1]: Started Cleanup of Temporary Directories.<\/pre><h3 class=\"wp-block-heading\" id=\"h-combining-with-grep-to-filter-output\">Combining with grep to filter output<\/h3><p>The <a href=\"\/ng\/tutorials\/grep-command-in-linux-useful-examples\">grep command<\/a> lets you filter another command&rsquo;s output using keywords. It enables <strong>watch<\/strong> to print only the relevant data, minimizing the output for a more efficient analysis.<\/p><p>When using <strong>grep,<\/strong> your <strong>watch<\/strong> command syntax will change slightly. Since we will use a pipe (<strong>|<\/strong>) to pass the output, we must group the commands using quotation marks. Consider the following example:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">watch -n 5 \"ps aux | grep 'root'\"<\/pre><p>The snippet monitors new processes, passing it to the grep command to show only new entries containing the word<strong> root<\/strong>. The output might look as follows:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">root 1 0.0 0.3 169344 13812 ? Ss Sep22 0:18 \/sbin\/init\nroot 2 0.0 0.0 0 0 ? S Sep22 0:00 [kthreadd]\nroot 3 0.0 0.0 0 0 ? I&amp;lt; Sep22 0:00 [rcu_gp]\nroot 4 0.0 0.0 0 0 ? I&amp;lt; Sep22 0:00 [rcu_par_gp]\nroot 5 0.0 0.0 0 0 ? I&amp;lt; Sep22  0:00 [slub_flushwq]<\/pre><p>Whenever the output of your command changes, grep automatically filters it. This means you will only get a new terminal entry when relevant data registers.<\/p><h3 class=\"wp-block-heading\" id=\"h-using-watch-with-custom-scripts\">Using watch with custom scripts<\/h3><p>In addition to commands, <strong>watch<\/strong> lets you repeat script execution. Scripts are useful if you have custom tasks involving multiple utilities and complicated logic. Moreover, scripts are more modular and easily reusable than commands.<\/p><p>To create a bash script, run the following commands. Replace <strong>myscript<\/strong> with your desired name:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">nano myscript.sh<\/pre><p>Write your script logic. For example, let&rsquo;s make a simple one that prints the current system date and uptime:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">#!\/bin\/bash\necho \"Current date and time: $(date)\"\necho \"Uptime: $(uptime)\"<\/pre><p>Hit <strong>Ctrl + X &rarr; Y<\/strong> <strong>&rarr;<\/strong> <strong>Enter<\/strong> to save the file. Make the script executable to allow the <strong>watch<\/strong> command to run it:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">chmod +x myscript.sh<\/pre><p>Run the script using the <strong>watch<\/strong> command like so. For example, we will set the interval to five seconds:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">watch -n 5 .\/myscript.sh<\/pre><p>The output should look as follows, with the date and uptime updating every five seconds.<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">Current date and time: Tue Sep 24 06:00:32 AM UTC 2025\nUptime: 06:00:32 up 1 day, 17:50, 1 user, load average: 0.17, 0.09, 0.03<\/pre><h2 class=\"wp-block-heading\" id=\"h-conclusion\">Conclusion<\/h2><p>The <strong>watch<\/strong> command lets you repeat another command at a specific interval. It makes monitoring real-time data like processes, resource consumption, and logs easier since you don&rsquo;t need to re-run the command manually to update the output.<\/p><p>To use this utility, enter<strong> watch<\/strong> followed by the command you want to repeat. You can also add options to modify its behavior based on your monitoring needs. For example, insert <strong>-n<\/strong> to change the execution interval and <strong>-g<\/strong> to automatically stop the command when the output changes.<\/p><p>You can use<strong> watch <\/strong>with various commands, including<strong> top<\/strong>, <strong>ls<\/strong>, and <strong>ds<\/strong>. Since this utility is versatile, experiment with different combinations to familiarize yourself with the tool and find a suitable use case for your needs.<\/p><p>For Hostinger VPS hosting users, we recommend using <a href=\"\/blog\/kodee\">Kodee AI Assistant<\/a> to write the <strong>watch <\/strong>command quickly. You can also ask Kodee to show you your VPS&rsquo;s current system usage and the latest log files whenever you need them without manually entering commands.<\/p><h2 class=\"wp-block-heading\" id=\"h-the-linux-watch-command-faq\">The Linux watch command FAQ<\/h2><div class=\"schema-faq wp-block-yoast-faq-block\"><div class=\"schema-faq-section\" id=\"faq-question-1727357693554\"><h3 class=\"schema-faq-question\">What is the purpose of the Linux watch command?<\/h3> <p class=\"schema-faq-answer\">Linux <strong>watch<\/strong> lets you automatically repeat another user-defined command execution at a specific interval. It is useful for monitoring commands&rsquo; outputs without rerunning them manually. For example, you can track new logs, processes, and system resource usage.&nbsp;<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1727357700685\"><h3 class=\"schema-faq-question\">Can the Linux watch command continuously monitor file changes?<\/h3> <p class=\"schema-faq-answer\">Yes, you can check changes in a file using <strong>watch<\/strong> by repeating the<strong> tail <\/strong>command. It prints the last few lines from a file, allowing you to check if new data exists.&nbsp;<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1727357710474\"><h3 class=\"schema-faq-question\">Can I use the watch command to monitor multiple commands simultaneously?<\/h3> <p class=\"schema-faq-answer\">Yes, you can use <strong>watch <\/strong>on multiple commands by listing them inside quotation marks separated by operators. Use the double ampersands (<strong>&amp;&amp;<\/strong>) operator to run commands only after the previous one has succeeded. If you want to ignore this rule, use the semicolon separator (<strong>;<\/strong>).<\/p> <\/div> <\/div><h3 class=\"wp-block-heading\" id=\"h-\"><\/h3>\n","protected":false},"excerpt":{"rendered":"<p>The Linux watch command is a powerful tool that runs user-defined commands at regular intervals and displays the output. It&rsquo;s important for monitoring processes and system resources in real time without manually re-running commands. Whether you&rsquo;re tracking disk usage, monitoring network interfaces, or observing file and directory changes, watch helps streamline these tasks. In this [&#8230;]<\/p>\n<p><a class=\"btn btn-secondary understrap-read-more-link\" href=\"\/ng\/tutorials\/linux-watch-command\">Read More&#8230;<\/a><\/p>\n","protected":false},"author":411,"featured_media":145119,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_title":"Linux watch command","rank_math_description":"The Linux watch command is a command-line tool that runs user-defined commands at regular intervals. Check this article to learn how to use it.","rank_math_focus_keyword":"linux watch","footnotes":""},"categories":[22644],"tags":[],"class_list":["post-15899","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-vps"],"hreflangs":[{"locale":"en-US","link":"https:\/\/www.hostinger.com\/tutorials\/linux-watch-command","default":0},{"locale":"fr-FR","link":"https:\/\/www.hostinger.com\/fr\/tutoriels\/linux-watch","default":0},{"locale":"es-ES","link":"https:\/\/www.hostinger.com\/es\/tutoriales\/comando-watch-linux","default":0},{"locale":"en-UK","link":"https:\/\/www.hostinger.com\/uk\/tutorials\/linux-watch-command","default":0},{"locale":"en-MY","link":"https:\/\/www.hostinger.com\/my\/tutorials\/linux-watch-command\/","default":0},{"locale":"en-PH","link":"https:\/\/www.hostinger.com\/ph\/tutorials\/linux-watch-command\/","default":0},{"locale":"es-MX","link":"https:\/\/www.hostinger.com\/mx\/tutoriales\/comando-watch-linux","default":0},{"locale":"es-CO","link":"https:\/\/www.hostinger.com\/co\/tutoriales\/comando-watch-linux","default":0},{"locale":"es-AR","link":"https:\/\/www.hostinger.com\/ar\/tutoriales\/comando-watch-linux","default":0},{"locale":"en-IN","link":"https:\/\/www.hostinger.com\/in\/tutorials\/linux-watch-command","default":0},{"locale":"en-CA","link":"https:\/\/www.hostinger.com\/ca\/tutorials\/linux-watch-command","default":0},{"locale":"en-AU","link":"https:\/\/www.hostinger.com\/au\/tutorials\/linux-watch-command","default":0},{"locale":"en-NG","link":"https:\/\/www.hostinger.com\/ng\/tutorials\/linux-watch-command","default":0}],"_links":{"self":[{"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/posts\/15899","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/users\/411"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/comments?post=15899"}],"version-history":[{"count":38,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/posts\/15899\/revisions"}],"predecessor-version":[{"id":145118,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/posts\/15899\/revisions\/145118"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/media\/145119"}],"wp:attachment":[{"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/media?parent=15899"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/categories?post=15899"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/tags?post=15899"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}