Linux Crash Course - The 'watch' Command

preview_player
Показать описание
When it comes to computing, it's often said that the key to efficiency is to not repeat yourself. That's true. Except for the the watch command - it's intended use-case is to repeat a command over and over. Believe it or not, it can really come in handy. Learn all about the watch command by watching this watch tutorial.

*Thanks to Linode for sponsoring this video*

*LEARN LINUX TV - YOUR HOME FOR LINUX-RELATED FUN AND LEARNING!*

Support Linux Learning and check out Netdata, a powerful utility that enables you to easily and proactively monitor your business, home, or homelab network

*🎓 BRAND NEW UDEMY COURSES AVAILABLE!*
Check out my new courses on Udemy and learn something new!

*🐧 SUPPORT LINUX LEARNING!*
_Note: Royalties and/or commission is earned from each of the above links_

*⏰ TIME CODES*
00:00 - Intro
02:06 - An example of the watch command in action in a Linux Shell
04:20 - Using the watch command to keep an eye on your server's storage
05:02 - Keeping an eye on your server's memory usage with the watch command
06:25 - Highlighting changes while using the watch command on your Linux Server
07:14 - Using the -n option with the find command to tweak the repeat interval
09:02 - How to use the watch command with a command that contains pipes or redirects*🎓 FULL LINUX COURSES FROM LEARN LINUX TV*

*🌐 LEARN LINUX TV ON THE WEB*

Learn Linux TV provides technical content that will hopefully be helpful to you and teach you something new. However, this content is provided without any warranty (expressed or implied). Learn Linux TV is not responsible for any damages that may arise from any use of this content. The person viewing Learn Linux TV's content is expected to follow their best judgement and to make their best decisions while working with any related technology. Always make sure you have written permission before working with any infrastructure. Also, be sure that you're compliant with all company rules, change control procedures, and local laws.

#Ubuntu #DevOps #DevOpsTraining
Рекомендации по теме
Комментарии
Автор

At work, I used watch to diagnose scales. There were scales that transmitted data to a computer via USB. The program from the manufacturer allowed me to get the weight once, I ran it through watch with a minimum delay (0.1 second) and moved the cable to determine the bad contact.

Worth mentioning, in FreeBSD the built-in watch command does something very different. The command from GNU/Linux is called gnu-watch there.

kote
Автор

I will be making a lot of use of this command.

And for fun, a fortune every minute.

I love finding out about new commands to me.

wisteela
Автор

Hi from France,
Former Linux fighter since RedHat 5.5 where you had to install everything in text mode, I am currently on the Zorin OS 16.2 Core.
Thanx for your humour and very serious videos... 😎
Best wishes 2023 🥂🍀

ritchiebluesman
Автор

watch -n 10 -d is my default goto, with df -h or ls -la

rotflol
Автор

I use the watch command in connection with the sensors command to keep an eye on system temps: 'watch sensors -f'
The -f flag puts the output in degrees F, the default is degrees C.

Not-THAT-ChrisPratt
Автор

I was gonna recommend you do inotify and incrontab, see someone else also mentioned them. Very important tools on our servers.

binbashbuddy
Автор

use watch to build a custom top-like overview of system resources, files, cluster info or whatever you want to monitor 8-)

rotflol
Автор

Great video, as always, Jay!
I realized something when you ran 'watch free -h' and you did not go into the details about the free command. Your videos follow one of the Unix principles: Do one thing and do it well. All your videos follow this, and I appreciate this. ;-)
Keep up the great work.

Not-THAT-ChrisPratt
Автор

Enjoyed this video! Your channel is a real gem on youtube. Please continue producing such a great content in 2023 :) Happy holidays for you and your family

damianpodgorski
Автор

Extremely helpful as all of your tutorials have been

Goldcrowdnetwork
Автор

very good guy, very good videos - Linux is so easy with it - Thank you very much Jay

remychrist
Автор

good video. I might have the courage to start the bash series this weekend.

Ranblv
Автор

Love this series, thanks Jay.
Have a happy Christmas time.

TradersTradingEdge
Автор

Can I build a web page or server for all my photos for people to look at, thru a iPad only, or is that what Linode is for?

bobsisic
Автор

Hello Jay. Can you make some lessons about Linode?

mlm.online-um
Автор

I have been combining watch with sensors for years and of course I aliased it. To see the temperatures of my hardware and the power of my graphics card. Sadly there still is a bug in the drivers for both the fan-rpm (Bad motherboard-support for Linux? The graphics card rpm is shown, the case-fan and CPU-fan RPM are not) and the CPU-power. AMD used to show the CPU-power for Zen2 but quit doing that because it was not always accurate and AMD wanted to prevent users from damaging their hardware because they used wrong data (official communication from AMD).

peterjansen
Автор

I usually use inotifytools to watch files. When my script detects changes it then does a bunch of stuff like load a file to a database.

bobbydigital
Автор

Hey Jay I enjoy your videos. I would like see a video on the tldr command/apt. It would fit right in with your videos. We could do a: tldr watch and read along as you discribe the use of the command. It's a short version of the --man option. Folks if you want to do something crazy try this command: compgen -c.
This will print a list of all the commands to the terminal. You will get about 5000 items scrolling up your screen so do a tldr on it first.

richardpremeaux
Автор

This seems very similar to inotifywait /inotifywatch. I wonder if the watch command can be used in a comparable way. I have an inotifywait script running that watches my game screenshots folder then posts new screenshots to discord automatically.

wesgould
Автор

If you use `watch -n 1 -t date` you'll have a clock 😂

hansisbrucker