Linux Sysadmin Basics -- 6.3 The /proc Filesystem

Sdílet
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...

Komentáře • 96

  • @WilliamBurlingame
    @WilliamBurlingame Před 8 lety +191

    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.

    • @sabyasachikgp
      @sabyasachikgp Před 7 lety +26

      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!

    • @WilliamBurlingame
      @WilliamBurlingame Před 7 lety +31

      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.

    • @josephfilm73
      @josephfilm73 Před 5 lety +8

      @@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.

    • @patjustpat8178
      @patjustpat8178 Před 5 lety +12

      And here I am, 26 and doubting if it's "too late". FML

    • @2Worlds_and_InBetween
      @2Worlds_and_InBetween Před 3 lety

      @@sabyasachikgp im learning more and more faster and faster.
      & even i av said im creeping up towards
      ol fart

  • @samuraijack5919
    @samuraijack5919 Před 4 lety +26

    *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.

  • @pipe_dev_null
    @pipe_dev_null Před 9 lety +51

    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!

    • @tutoriaLinux
      @tutoriaLinux  Před 9 lety +11

      +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!

  • @Core2lee91
    @Core2lee91 Před 9 lety +24

    Thanks for taking the time to make these. You, amongst others on here have gotten me my first job as a Linux sys admin.

    • @tutoriaLinux
      @tutoriaLinux  Před 9 lety +7

      W00T! Awesome, have fun! This is such a cool career with such cool, smart people. Enjoy it!

    • @RenJohn78
      @RenJohn78 Před 7 lety +2

      This is my dream job! I'm studying Daves videos religiously.

  • @elielberra2867
    @elielberra2867 Před měsícem

    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 :)

  • @deamon91
    @deamon91 Před 5 lety +16

    morpheus has entered the building

  • @uhoh007
    @uhoh007 Před 6 lety

    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.

  • @ajopasoij9d00
    @ajopasoij9d00 Před 6 lety +3

    It's 2018 and this is still the best sysadmin tutorial I've found!
    Thank you for putting out this content.

  • @Pardaillan81
    @Pardaillan81 Před 8 lety +6

    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.

    • @tutoriaLinux
      @tutoriaLinux  Před 8 lety +5

      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.

  • @brrrrr256
    @brrrrr256 Před rokem

    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.

  • @sigmundavila7252
    @sigmundavila7252 Před 9 lety +2

    Great video. I learned so many things from you. Thank you for sharing your knowledge.

  • @DarkXagami
    @DarkXagami Před 20 dny

    Well. This wraps up day 3! I find myself understanding everything you're talking about. Now, about that "strace" command! lol

  • @djidave2083
    @djidave2083 Před 8 měsíci

    thank you for your video. helping me to consolidate my training

  • @donnypodcast
    @donnypodcast Před 3 lety

    Sounds like good advice "looking directly at the matrix for too long is not recommended" ... Mr. Anderson

  • @jasons1856
    @jasons1856 Před 3 lety

    Thanks for covering the strace command.

  • @XhubiuXRock
    @XhubiuXRock Před 8 lety +3

    you're the best man!! thanks!!
    Matriiixxx yeaaah!!

  • @PhilipKirkbride
    @PhilipKirkbride Před 7 lety +17

    Did you ever make a video on strace

    • @2Worlds_and_InBetween
      @2Worlds_and_InBetween Před 3 lety

      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

  • @StevenSmith-qz9zg
    @StevenSmith-qz9zg Před 7 lety +3

    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! ;)

  • @shioriko809
    @shioriko809 Před 6 lety

    Thank you! This video was very informative and helped me get the basics down.

  • @satyajakinnara36
    @satyajakinnara36 Před 7 lety

    '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

  • @vsworld7757
    @vsworld7757 Před 9 lety

    Informative.. Thanks Much for your time and for sharing knowledge.. Great Thanks!

  • @cMaXeJIJIo
    @cMaXeJIJIo Před 9 lety

    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!

    • @tutoriaLinux
      @tutoriaLinux  Před 9 lety

      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!

  • @PunmasterSTP
    @PunmasterSTP Před 2 lety

    /proc? More like /perfect! Thanks for sharing.

  • @mevlentips9844
    @mevlentips9844 Před 3 lety

    The Matrix stuff is great ...Great Teacher ,with a Grep sort of humor :D

  • @bitgoblin8497
    @bitgoblin8497 Před 6 lety

    Love the videos ! I still pretty green with Linux and your video help and give me lots of homework :)

  • @AndreKhan716
    @AndreKhan716 Před 7 lety

    Nicely done, thanks!

  • @Musouka3
    @Musouka3 Před 4 lety +1

    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!

  • @itsrack
    @itsrack Před 5 lety

    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.

  • @keefo.
    @keefo. Před 10 lety

    very useful video, thanks

  • @benjamin2662
    @benjamin2662 Před 5 lety

    learned a lot well done

  • @taxhidinkadiri5629
    @taxhidinkadiri5629 Před 6 lety

    Your video are great, i am Telecommunication engineer

  • @broadyville1
    @broadyville1 Před 7 lety

    awsome!!! Thank you sooo much.

  • @andreviniciusbezerradasilv1255

    thanks

  • @Alexbl100
    @Alexbl100 Před 3 lety

    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?

    • @tutoriaLinux
      @tutoriaLinux  Před 3 lety

      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.

  • @kennethnicklowicz1030
    @kennethnicklowicz1030 Před 8 lety

    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

  • @RyanFromUltrasound
    @RyanFromUltrasound Před 6 lety

    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?

    • @Dormano_Wild_Rift
      @Dormano_Wild_Rift Před 5 lety

      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

    • @euroaEU
      @euroaEU Před 4 lety

      @@Dormano_Wild_Rift yes, cat maps is the command

  • @nsmkhn
    @nsmkhn Před 5 lety

    Could you please make a video about capsh utility?

  • @ricardo.mazeto
    @ricardo.mazeto Před 8 lety

    Hi Dave, do you have some book recommendation on the topic?

  • @wolfganggermain7175
    @wolfganggermain7175 Před 5 lety

    promise on strace noted and request made ;)

  • @RUSTY93
    @RUSTY93 Před 6 lety

    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.

    • @tutoriaLinux
      @tutoriaLinux  Před 6 lety

      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).

  • @Blujay188
    @Blujay188 Před 4 lety

    how would one be able to query information from the proc file system through a shell script file?

  • @VedurlaSudhir
    @VedurlaSudhir Před 6 lety

    Could you explain about strace?

  • @pukka4140
    @pukka4140 Před 8 lety

    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

    • @tutoriaLinux
      @tutoriaLinux  Před 8 lety

      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.

  • @ajkourafas
    @ajkourafas Před 4 lety

    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?

  • @Ryuudo123
    @Ryuudo123 Před 7 lety

    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

    • @euroaEU
      @euroaEU Před 4 lety

      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

  • @user-yt3gi5if9e
    @user-yt3gi5if9e Před 6 lety

    Hey, when i typed df -ah, i didn't find the proc file, what's problem with my system? can you give a hint?

  • @legendarytwister3656
    @legendarytwister3656 Před 4 měsíci

    what's that black square that's appearing in your videos at random places and times?

    • @tutoriaLinux
      @tutoriaLinux  Před měsícem +1

      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!

    • @legendarytwister3656
      @legendarytwister3656 Před měsícem

      ​@@tutoriaLinux Not a problem for me, I was just curious. Thanks for the respond! :D

  • @mickeysmiles1
    @mickeysmiles1 Před 9 lety

    Can I delete the kcore file in the proc directory?

  • @san21213
    @san21213 Před 5 lety

    at 4:11 you typed something to get memory mapping. I couldn't see the command.

    • @viorelmnk
      @viorelmnk Před 4 lety

      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" :))

  • @networksystemguy9120
    @networksystemguy9120 Před 3 lety

    Now , I'm saying it : This is the most sexiest thing in the world !! Loved it dude

  • @possiblewhiteguy
    @possiblewhiteguy Před 2 lety

    "Looking directly at the matrix for too long is not recommended" - tutorialLinux

  • @hooblydoobly9125
    @hooblydoobly9125 Před 9 lety

    i love you

  • @arbaazmir1683
    @arbaazmir1683 Před 4 lety

    1:57 lol

  • @infuri7939
    @infuri7939 Před 6 lety

    Pretty sure I spent 20 minutes cat-ing out the init /proc files...

  • @jenniferrussell2866
    @jenniferrussell2866 Před 2 lety

    $$$$$$$$

  • @luislo01
    @luislo01 Před 6 lety

    Some of the videos very interesting, this one NO!!!!

  • @andreviniciusbezerradasilv9335

    thanks