Linux Sysadmin Basics -- 6.3 The /proc Filesystem
Vložit
- čas přidán 13. 09. 2024
- What is /proc in Linux? How do top and other Linux monitoring programs know what resources each process is using? This video is an overview of the /proc filesystem on Linux, which is your first taste of LOOKING AT THE MATRIX ITSELF -- erm...or rather, the source of much of the process-monitoring data you'll be seeing in Linux.
My step-by-step project-based Linux course for beginners: www.udemy.com/...
Free Linux Sysadmin Course Playlist: • The Linux Basics Cours...
DigitalOcean referral link: m.do.co/c/0380...
Patreon: / tutorialinux
Official Site & e-mail list: tutorialinux.com/
Twitter: / tutorialinux
Facebook: / tutorialinux
Podcast: kernelpanicpodc...
Thanks for the video. I’m an 80 year old retired programmer. Most of my experience was system level SW written in assembly language, but I haven’t written anything for the last 18 years. I started working as a programmer in the 1960s. At home, I’ve stuck to Windows as a user since retirement. Last year I bought a Raspberry Pi 2 and installed Raspbian. I recently tried to set up the RPi2 as a WiFi access point. I blindly did a copy and paste from web sites that had instructions. Mine didn’t work and I realized that I don’t have the knowledge to trouble shoot the problem. I’m hoping that I can eventually learn enough to figure out why my project isn’t working. I’ve installed Unbuntu, Mint and Debian in VM Ware. I’ve been following along with you videos using the Ubuntu install.
Sir, You are an inspiration to people like me. I often flinch at the thought of getting old as I would not able to code any longer :( and may end up doing mundane managerial job. Your words will encourage people like to stick to what they like to do. Thank You! Real Programmers never dies or age. They just go offline for a while!
Thanks for the compliment. Since I posted the previous message, I've turned my R Pi 2 into a NAS that I use for backup only. I have two 2 TB, a 4 TB and two 5 TB drives available for backup. Most of the data consists of recorded movies and they use a lot of storage.
@@WilliamBurlingame You're never too old to explore (and by doing so, learn), especially if you've a background in the topic. It's just a somewhat different way of doing things.
And here I am, 26 and doubting if it's "too late". FML
@@sabyasachikgp im learning more and more faster and faster.
& even i av said im creeping up towards
ol fart
*My Notes*
Linux Sysadmin Basics -- 6.3 The /proc Filesystem
--
1:10 What do you use 'ps' for?
listing processes
--
1:15 The kernel automatically monitors the state of each process via a virtual file system called:
/proc filesystem
(currently running/active processes)
--
3:51 cwd
get path name of current working directory / show you where the process is operating from
(similar to pwd but without the trailing line terminator)
--
4:04 What does 'fd' in 'ls fd' do?
List file descriptors for you
--
4:07 What does 'map' in 'ls map' do?
List memory mapping info for you
(if you wanna see what shared libraries it is using, more at 6:14)
--
4:42 Mr. Anderson
--
5:24 The file 'cmd' will generally be what ________ the process is currently executing.
command
--
5:35 The 'cmdline' is generally how the process was ___________.
called
--
5:50 What does 'environ' show you?
(ex syntax: cat environ)
environment variables
- path
--
6:22 What will 'statm' show you?
(ex syntax: cat statm)
Memory
--
6:26 Remember: quite a bit of this stuff isn't really legible in its native form, it is meant to be used in conjunction with other programs like htop.
You start to appreciate the functionality that is built into linux/BASH commands here.
--
8:01 strace
(command)
Attach two processes & really see what they are doing
(in a way that is very difficult otherwise)
- this is a vital tool for sysadmins, you NEED this
--
Tell me if I missed anything. Have a great day and be safe.
Good Job !!
Hey, Dave - I just started watching through your videos and am finding them extremely helpful. Most of the informational videos (linux or otherwise) out there are incredibly boring and/or hop around too much, making it hard to follow. Your videos are superbly laid out and you give just enough information to get someone like myself rolling but not too much where you're going down the rabbit hole. Thanks a ton for your efforts. These have helped me more than any other source (books, ebooks, tutorials, online classes, etc.). Thanks again and keep the videos coming!
+Ben Mercier Ben, this is fantastic to hear -- that's exactly the niche I am trying to fill with these videos. I started making these for a friend who had the same complaints as you about the existing videos/books/etc. Anyway, keep experimenting, stay hungry, and enjoy!
Thanks for taking the time to make these. You, amongst others on here have gotten me my first job as a Linux sys admin.
W00T! Awesome, have fun! This is such a cool career with such cool, smart people. Enjoy it!
This is my dream job! I'm studying Daves videos religiously.
Thank you so much for these series of videos on processes! I found it super clear and extremely useful, I can't believe I haven't run into your channel before it is amazing :)
morpheus has entered the building
I'm a consultant who has lasted many years without CLI competence, because I just did not need it. I built many PCs, and setup many home networks, and of course on occasion I did some copy and pasting of commands in windows and macs. I only recently got into Linux as a way to build a remote backup system for my clients, and use the tons of old hardware I have lying around. I started with Joe Collins really nice basic intro, but at heart I am seriously ADD, and your concise information packed presentation, great demeanor, humor, are perfect for my crash foray in Linux, and all the doors it opens: freeNAS, ZFS, containers, KVM, even kubernetes and all that Jazz. Invaluable to my career, and by extension, my family. Thank You, Dave, sincerely.
It's 2018 and this is still the best sysadmin tutorial I've found!
Thank you for putting out this content.
Great tutorials! I tried to understand CLI and how Linux works many times. I find the other Linux tutorials incredibly boring and dry. Yours are very good though. I never came so far in understanding what the CLI is about. I plan to watch all the videos in this tutorial. If appropriate, I will include a few comments at the end. It just happens that I am a medical professional with an interest in IT. It may be useful to bear in mind that there are many other professions apart from the IT technicians that may be interested in this information. Therefore putting this information in plain terms is very important and you've done a great job.
Thanks! I agree; it's really important to make this information accessible to as many people as possible. Both system administration and programming are skills that are wonderful on their own, however they become a *superpower* when they're mixed with expertise in other fields, especially the sciences.
OK - this is finally getting good ;) Been a programmer since the 80's but never went this far into Linux. I'm glad to be going through all of these (in order) to catch up on what I've been missing.
Great video. I learned so many things from you. Thank you for sharing your knowledge.
Well. This wraps up day 3! I find myself understanding everything you're talking about. Now, about that "strace" command! lol
thank you for your video. helping me to consolidate my training
Sounds like good advice "looking directly at the matrix for too long is not recommended" ... Mr. Anderson
Thanks for covering the strace command.
you're the best man!! thanks!!
Matriiixxx yeaaah!!
Did you ever make a video on strace
Hahaha... just down the bottom of my...
(keeps track of input via...
a side of my old man's way he explained the 3x3 way of keeping the comments)
here
there
&FF'ing everywhere
in,
this
that
& the others
This is great. Reminds me pre-windows 95 real DOS from when I was a kid. Lol. Actually.. even before that, during the apple ][ c/e, macintosh, and basic days. Gotta love something that's the opposite of windows! ;)
Thank you! This video was very informative and helped me get the basics down.
've found your channel by accident and it's awesome: your style of presentation, the info itself being presented.please do a video on strace. thank you
Informative.. Thanks Much for your time and for sharing knowledge.. Great Thanks!
Hey, Dave!
I've found your channel by accident and it's awesome: your style of presentation, the info itself being presented...Just what I need to fill in the holes from my high school/college days of chilling on SolarisOS and ATTEMPTING to program lol
I wanted to give you a quick heads-up: I think there's a mistake in your playlist-the 7.1 video comes before the 7.
Keep the GREAT work!
cMaXeJIJIo You rock! Thanks for pointing that out. Fixed. By the way, if you enjoyed Solaris, Illumos is pretty cool although I don't have much experience with it. Also, SmartOS is pretty interesting, although I only played with it for a few days. Cheers!
/proc? More like /perfect! Thanks for sharing.
The Matrix stuff is great ...Great Teacher ,with a Grep sort of humor :D
Love the videos ! I still pretty green with Linux and your video help and give me lots of homework :)
Nicely done, thanks!
04:08 after typing "ls maps", the system just returns "maps" and then nothing happens. What did you press to make all those numbers appear on screen? I really wanna look into the matrix, too!
And many thanks for these awesome videos!
cat maps
Hey Dave, Thanks so much for this and about the matrix, Keanu Reeves Chapter 3 Parabellum is how excited are you about it..!! Im sooo excited you said it. Thank you and have a wonderful night.
very useful video, thanks
learned a lot well done
Your video are great, i am Telecommunication engineer
awsome!!! Thank you sooo much.
thanks
Just wondering so forgive my ignorance.
The reason why file size is 0 on all those directories in /proc/ is because most of the things there representing processes live in memory rather than in disk space?
Exactly -- in Linux, files are more or less "things that support linux file operations" like READ, SEEK, etc. One of the genius bits of Linux is that you can treat almost everything as a file -- including live kernel state -- which gives you a really consistent interface to do things on the system with. These "files" in /proc don't really exist except as a filename, and when you try to do file operations on them (e.g. READ), their content suddenly pops into existence with the kernel's current answer/metric for whatever that filename is supposed to look up.
As you can see i have spent some time on these videos. Now have 2 pcs loaded with linux. Can you do some videos on QoS and opensource routers? id like to say I am going to be able to understand my box after watching most of these
Thank you for this series. I'm a little confused about what happening at 4:11 when you say the word "information". I'm not seeing any input into the command line but it looks like you listed a directory or something. Was your keystroke so fast I missed what you typed or did you just hit enter?
not sure if you still looking for an answer, but I was looking for the same question hoping someone will answer. Basically he just cut something out. :) but I managed to get same result by invoking command: cat maps
@@Dormano_Wild_Rift yes, cat maps is the command
Could you please make a video about capsh utility?
Hi Dave, do you have some book recommendation on the topic?
promise on strace noted and request made ;)
Does this course run through something that will help me understand how I could use my VPS as hosting and connect it to a Domain name?
Thx for this Dave been running through your course from scratch and been documenting everything I learn.
The course playlist will help you understand all of the fundamentals you need for Linux system administration. If you want something more practical, check out my practical WordPress/Web Hosting course (Udemy link in the description).
how would one be able to query information from the proc file system through a shell script file?
Could you explain about strace?
Hey Dave,
Tutorials are nice do we have shell scripting in this series?
What is the command for sorting logs? An employer asked me?
Thanks in Advance
Sure! I created a bash scripting series a while back: czcams.com/play/PLtK75qxsQaMIlFCcFZpTBLnaCJ0I0uiaY.html
For specific problems (like sorting logs based on specific criteria), Google is the place to search.
When i use strace on htop and try to send the output to a file it ends up blank. strace -p 20477 >> /home/username/Desktop/strace creates the file, but it remains blank. Any idea why or what i'm doing wrong?
watched the previous videos, now this one and the sensation that im getting here, "wth is going on" just thrown out a bunch of commands without clear explanation what they are and why we use them...in the first video it was assumed no previous knowledge is needed, well I had no previous knowledge and for the first few it was easy to follow along but this one is where I get the feeling im lost with whatever is going on on the screen.
only the ls command is clear :P
hello, use command: man proc where you will find all informations about proc "hierarchy" so it will help you understand what's going on in this chapter
Hey, when i typed df -ah, i didn't find the proc file, what's problem with my system? can you give a hint?
what's that black square that's appearing in your videos at random places and times?
If you can see the black square, you belong to the brotherhood of The Few Who Can See (tm) and who will become Linux experts in a shockingly short amount of time! oooo
Jk it was a horrible artifact around my mouse cursor due to the awful recording software I used in my early videos. It'll go away in later videos, I promise. Sorry!
@@tutoriaLinux Not a problem for me, I was just curious. Thanks for the respond! :D
Can I delete the kcore file in the proc directory?
at 4:11 you typed something to get memory mapping. I couldn't see the command.
cat maps . you should have used pause and capture the moment. I know, had the same issue at first. I also had problems figuring out what he did to list "the matrix" :))
Now , I'm saying it : This is the most sexiest thing in the world !! Loved it dude
"Looking directly at the matrix for too long is not recommended" - tutorialLinux
i love you
1:57 lol
Pretty sure I spent 20 minutes cat-ing out the init /proc files...
$$$$$$$$
Some of the videos very interesting, this one NO!!!!
thanks