Linux Command-Line for Beginners: What's happening on this machine?
About the Video:
A basic introduction to help you figure out what's happening on your machine, using the most popular programs for:
1. Seeing who is logged in and what they are doing,
2. Seeing which programs are using the most resources
3. Seeing what might be exposed to the network. (netstat)
Once you've mastered the commands in this video, you'll be able to quickly find out what's happening on a machine when you log in.
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...
Пікірлер: 137
Chapter 3: Linux Command-Line for Beginners: What's happening on this machine? -------- Notes on symbols and codes: ---------- -------- Basic Codes: -------------------------- w provides information on users, uptime, local or external user every terminal that is opened is also shown TTY = Terminal, FROM = where (0 = local), LOGIN@ = login time IDLE = Idle Time, ... WHAT = what process is being run by that user/terminal who short information on users and log in time top process manager/ task manager (shows top programs requiring CPU power) PID (number) is used to stop a specific process netstat -tupln shows information about local addresses and programs that are being run from those locations DON'T USE netstat without any flags, as it will give you a huge amount of information. ----------- Software packages: ---------------------- If you run into problems with software (while following the tutorial), use the following command: sudo apt-get install followed by these packages: htop net-tools
@clarenceonyekwere5428
4 жыл бұрын
Anyone having errors with installing net tools should check these 3 steps itsfoss.com/unable-to-locate-package-error-ubuntu/
@illiiilli24601
4 жыл бұрын
Thanks for putting your notes here, I really appreciate it. One nice thing would be to put time stamps, but that's asking too much from you
@vusu5657
3 жыл бұрын
w command doesn't show all pseudo-terminal sessions. can you help.?
Landed a sysadmin job with the requirement of linux skills, dude, u are a lifesaver.
@BlackamusJones
6 жыл бұрын
Was this an entry level job?
@Jessica-ig5sp
5 жыл бұрын
@@BlackamusJones i wonder if he has a cert or degree? my cousin got in the field with out either and landed a system admin job im currently studying all this and books.
@alekodimitrov2635
4 жыл бұрын
@@Jessica-ig5sp How's it been bro, you still learning?
@aty4282
4 ай бұрын
@@Jessica-ig5sp you gave up? Had your cousin got people inside before he got hired? because thats one way to get there without anything lol
I am on my programmer learning path, but not knowing why and how made feel like a imposter and put to much pressure on me, so i paused learning python and started learning Linux os. This gem of series you made is a life saver. Thank you very much Sensei!
Your channel is a must-watch for me and I've learned a ton. Thanks man!
@Dispatern
7 жыл бұрын
Yeah, it's pretty neat
March 2018 update: Netstat is no longer included by default and must be installed with your package manager on the latest version of Ubuntu. (sudo apt install net-tools) - Yes, they also changed the package name...
@magnuskorneliusson152
6 жыл бұрын
Thanks!
@yizreelchen2231
4 жыл бұрын
Thanxs.I was wondering why i could't make it
@vusu5657
3 жыл бұрын
w command doesn't show all pseudo-terminal sessions. can you help.?
Thank you for making these videos. Great work and super helpful. I started my infosec journey a couple months ago and am currently reading through “Linux Basic for Hackers” by OTW as well as working through modules in Hack The Box Academy. With HTB especially even their beginner stuff assumes you have a decent understanding and foundation for Linux. Your video are the clearest and most straightforward ones I’ve found this far and have been a huge help.
Dave out here changing lives
Awesome vid Im gonna go through the whole playlist. I realy like that you have a summary below the video as well.
w - shows who is logging and what they are doing netstat -tupln shows tcp/upd/process/listen/numeric of connection information top/htop likes taskmanager in windows Very helpful!
A - Alpha: The first star in a constellation ie - Alpha Centauri. E - End, like you said. Great series so far, thank you.
It took me 1hr to understand these cmds thanks we got chat gpt
This is exactly what I needed to know I configured my firewall correctly, so it really helped. Of course to be sure I'd need to actually try attacking it myself but at least I now know that in my default setup all ports but the one I've limited to use for SSH is dead and no weird programs are listening.
What's happening on this machine? More like "Dang, these explanations are clean!"
Dave absolutely class mate back on track very well done.
if i open 2 terminals with htop command on one of them left running, and then when i use w on the other one i see only one session, does that mean anything?
@grigorynedaev7254
4 жыл бұрын
same here
@smisheduprog2475
3 жыл бұрын
idk what's going on, same thing with me
@Aphranteus
3 жыл бұрын
Are you on VM? Mine is not showing either, however I have Pop_OS on my machine installed. I've managed to find only information that in fact w should not display terminal sessions: unix.stackexchange.com/questions/441717/w-command-doesnt-show-all-pseudo-terminal-sessions
woww your timezone changing through command line was awesome
Excellent delivery, thank you for making these videos.
The equivilent for macbook Unix seems to be "sudo lsof -iTCP -nP | grep LISTEN", i'm using that one and trying to follow along. Thanks!
Thanks so much for the time you take on these great videos. Learning a ton from your channel.
Thank you so much for these videos. I learn a ton of new stuff.
I have learned very useful stuff in this video. Thanks a lot!
That little trick of running htop on one terminal then running the [w] command on a different terminal doesn't show different sessions for me, not sure why. BTW- glances is another great tool that shows system information.
@sonyj87
9 жыл бұрын
True
@lambertckw
7 жыл бұрын
anybody figured out why?..
@jean-naymar602
5 жыл бұрын
@@lambertckw Here's something I found that might explain why unix.stackexchange.com/questions/441717/w-command-doesnt-show-all-pseudo-terminal-sessions
What works best for me is going into root as an admin by typing sudo-s followed by netstat -tulpn.You can't go wrong.
Very much appreciated and helpful! Thank you!
09:10 I laughed too hard at that. Great series though, you got a teacher's gift for sure!
When I run htop in a second terminal, nothing happens in the first when I run w again.
@beagleonvodka
4 жыл бұрын
same here
@theracer182
4 жыл бұрын
@@beagleonvodka same
@tooturnt8824
3 жыл бұрын
its cuz he ssh'd in to th ubuntu virtual machine from i assume putty. if not a ubuntu vm prolly a pc running ubuntu
Im a software engineer but my linux skills suck ass. Im now finally required to live in a linux devbox in order to do useful things. Thanks for saving me!
sudo apt-get htop did not work instead sudo apt install htop worked
@genericmale3907
8 жыл бұрын
yeah ;)
@tutoriaLinux
8 жыл бұрын
Oops! Thanks for catching that and pointing it out to others.
@loganparrette2429
7 жыл бұрын
Perhaps the problem is that you did exactly that and altered your repository list. Default repository will pull it fine.
@maciejbacal5562
6 жыл бұрын
apt-get is deprecated on Ubuntu now, it's just apt
@samljer
6 жыл бұрын
neither worked for me, i had to use "sudo apt-get install htop"
Hey, I could use some help here. After i use "w" command (i've opened several terminals that run different things, python, htop etc.) all i see is i'm logged in once and i'm running sbin/upstart (WHAT /sbin/upstart) - i guess i should be able to see filip running python, filip running htop etc. what am i doing wrong? Ubuntu 16.04 LTS
@frozenfire72
4 жыл бұрын
Hey, did you get the answer to this yet? I am getting the same on Ubuntu 18.
with command W, what is giving me /usr/lib/gdm3/gd , Is this correct?
I'm enjoying the tutorials so far. I am a complete newbie to this so i have alot to learn. I downloaded & installed htop but when i run it & then i type in "w" at the command prompt in the first terminal it still shows up as one user. The tutorial seemed to say that you should see a new user when you open up a new terminal session. Am i missing something?
ive opened up other terminals and ran htop but it only shows as one user when i type w. why is mine different from yours?
@thekids4488
4 жыл бұрын
same
Awesome channel and very helpful playlist. Is there any particular Linux distro you'd recommend for a primary OS on a laptop that is strictly for home use?
@tutoriaLinux
7 жыл бұрын
I use (and really like) Arch for home/dev use. The Arch install process will teach you a lot about how the different parts of a Linux distribution are wired together.
@douglasfoster8347
7 жыл бұрын
Awesome. Thank you.
Fresh Ubuntu install and I have 3 terminal tabs open, 1 running htop... when I run "w" all I get is 1 row. Doesn't show the other processes/users running. Any ideas? Tried it on 1 different fresh install machines. Tried sudo w too.
@davidfite1978
3 жыл бұрын
Nevermind.. of course I found the answer right after asking the question. GNOME Terminal no longer updates the utmp directory with this info
i am running a kali on a vm when i hit the command " w " in the from attribute it says 1 instead of 0 , it should be 0 because its the local host what could be the reason for that ?!!
In case anyone is wondering on how to install net-tools in root: terminal sudo apt-get install net-tools
@098751thg
7 жыл бұрын
you da real mvp
thanks i'm learning a lot.
Is there a way to filter out essential processes or a way to flag processes as "essential" and filter them out in htop (or top)
At 7:25, *sudo !!* would be much quicker!!!
really it is very useful course, thank you
My terminal shows me just one user logged in whether i'm running htop in another terminal or somthing else or not... Why does it happen? Ubuntu 16.04
@VishalSharma-lz9qq
6 жыл бұрын
Any success ??
@aliwilson7658
6 жыл бұрын
you must run terminal on ssh with putty tools or something else...not just open terminals in the GUI ! all terminals that you open in the GUI count one session !! but every terminal that you open with a tools on ssh protocol count one session. are u understand ?
I run htop on another terminal but typing "w" doesn't show another user using htop. Any ideas?
Am I doing something wrong or does the video need an update? I opend a new terminal tab and made it run htop Also started a new Terminal with simply top when i tried also doing something in tty the host system took over so that didnt work in a virtual machine or the ubuntu keybindigs are unknown to me. anyhow; the output of w didnt change at all with any of the steps edit; also the used programs are shown nowhere
very good the explication of htop, we use but so is more understanding what is going. 🤔🙄
Hey Dave, awesome video like always man, but I have a question: when I run "w" on my ubuntu virtualbox, I only get myself running on :0 from :0 and is talking about my display manager. But it doesn't show anything about other processes I might be running. Any idea what could be happening?
@jean-naymar602
5 жыл бұрын
Same ! I was about to ask the question. What's your kernel version ? Mine is 18.04.* Apparently 'w' does not show virtual terminals anymore, but I'm not sure I understand the reasons unix.stackexchange.com/questions/441717/w-command-doesnt-show-all-pseudo-terminal-sessions *EDIT : 18.04 is not the kernel version, I got it wrong. This is my ubuntu version, not the kernel. Kernel is 4.x something
@tutoriaLinux
5 жыл бұрын
Yep, this is old behavior and a stupid example I should not have used -- sorry!
@vusu5657
3 жыл бұрын
@@jean-naymar602 thx
@vusu5657
3 жыл бұрын
cool thx
i have a problem here when i open 2 terminals and in the one i type top and the other w i dont see that user who runs top i only see one user whatever i do i only see that one user who isnt doing anything
@prem888you
6 жыл бұрын
same problem here
@VishalSharma-lz9qq
6 жыл бұрын
any update ??
@aliwilson7658
6 жыл бұрын
you must open 2 or 3 or... terminal on SSH not in the GUI.
@aliwilson7658
6 жыл бұрын
you must run terminal on ssh with putty tools or something else...not just open terminals in the GUI ! all terminals that you open in the GUI count one session !! but every terminal that you open with a tools on ssh protocol count one session. are u understand ?
@repulotaska
6 жыл бұрын
It was helpful for me!!!! Thank you!
Very useful. Thanks and God bless.
The only thing confusing about this is that htop wasn't installed so I had to run command line to install. I got the program to run, but still command W doesn't do anything :(
@fgeghfewfewf8532
8 жыл бұрын
+LyadinDima use lower case w
Great vid. So is this a good way to detect shells (both connected remotely or listening) Are there ways to detect hidden shells? If that's possible.
@tutoriaLinux
5 жыл бұрын
It's *one* way, as long as you trust the 'netstat' or 'ss' binary you're using to get this information from the kernel (someone could overwrite them and delete the output that shows their rootkit). Things like ossec and chkrootkit can also help, although monitoring network traffic from the *outside* is the only way to be sure in the event of a root compromise. I hope that helps!
@Gregorydaerr1971
5 жыл бұрын
@@tutoriaLinux actually it does help.....so external monitoring vs. From tools running on the kernel I'm monitoring. So I could put a linux box between the modem and the router and use it to look for the suspocious/malicious activity before it even arrives at its target and any outbound anomalies? What about tunneled traffic - wont that burrow past my linux monitoring box and firewalls etc....... or do you think it will also detect this activity still? P.s. windows is such a hole ridden OS. I block all 'x' traffic from network only to find that microsoft(micro-flacid) has a protocol that maps ' x' traffic thru an allowed different protocol. Or inability to block administrative shares..... .....or I just found that MICROSOFT LEAKED MY ONEDRIVE credentials that have been used to exploit other bugs (i.e. Zune music ap for example) I'm so over windows. Consumer level security competency for the average user is WAY TOO COMPLICATED AND OBFUSCATED to allow home users to secure their systems. .... state of cyber security today is a direct result of Microsoft's practices..... Sorry - you know this already I'm sure. But the more I learn, the deeper I delve into windows security features ......the more pissed off I get. I mean I get frustrated that there isint a push by EVERYONE for something better. As soon as someone sees this and offers a better solutuon........that day will be the beginning of the end of Microsoft. And I wont ever miss them.
none of these commands worked in my ubuntu terminal. when I type them, it just say "bash: /home/user: Is a directory"
cool colorscheme (theme). how do I do the same colors in terminal ??
I have 3 terminals running. But when I am doing W, I can only see one user. What is it I am doing wrong?
@tutoriaLinux
5 жыл бұрын
This was a bad example, sorry -- it was an implementation specific thing on the Ubuntu version I was running at the time and you're not crazy for not being able to replicate it. My bad!
@arsenalacid
4 ай бұрын
Had the same problem how do you fix it?
спасибо!
netstat is no longer used for ubuntu 20.04.
@tutoriaLinux
9 күн бұрын
It's true, but I still find myself installing the iptools package to get it (I think that's where it lives now?). I find sockstat more confusing and less convenient, and need more options and more grepping/piping to get the info I usually want. Maybe I'm just resistant to change.
my version of ubuntu (18?) isnt behaving like this at all. like for starters, i can open 5 terminals, and it still shows 1 user in both who and w. netstat doesnt exist, ? it had to be installed as part of net-tools? then when i did run netsat i got more then 20 pages of stuff... on a new install.. in a virtual machine.. with nothing installed... can you update these videos?
@miigoy
5 жыл бұрын
Were on the same page
doing great job!
when i press w in the terminal this message appears to me w:63 column window is to narrow so what is that suppose to mean
@tutoriaLinux
7 жыл бұрын
It means your window is too narrow! Try making the window wider.
@shriefelshorbagy7122
7 жыл бұрын
how can i make it wider
@tutoriaLinux
7 жыл бұрын
Google is better than KZread for questions like this!
@VishalSharma-lz9qq
6 жыл бұрын
Savage !! :P
whats the difference between the commands netstat and netstat -tupln?
@tutoriaLinux
7 жыл бұрын
The second one just has some convenient options added. You can see what all the options do by running 'man netstat'. Basically, in this case I only want to see TCP sockets and UDP sockets, process IDs, show usernames that launched the process using that socket.
htop command is not running in red hat.. can you please suggest ?
@bloodshiv4006
6 жыл бұрын
Have you first installed it using sudo apt install htop?
every time i install htop Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package htop this massage shows and ican't access htop
@tutoriaLinux
7 жыл бұрын
You may want to Google this, KZread isn't a good place for troubleshooting. If you're on Debian/Ubuntu/Mint, try doing a 'sudo apt-cache search htop' just in case the package name has changed.
Htop command didn't worked for me only top why is that? I am on fedora
@tutoriaLinux
4 жыл бұрын
I'm not sure what you mean by "didn't work" but it's probably not installed by default. Just install htop via the package manager and you should be good to go.
OMG it looks os cool
a man is leartning much from your channel
not all processes could be identified, non-owned process info will not be shown, you would have to be root to see it all. this came out whhen i tried netstat -tupln
@AlphaLimaTango
8 жыл бұрын
@7:20 he says this
I'm only 15 but can i study this in school? I always had a liking for computers
@tutoriaLinux
7 жыл бұрын
It's possible that your high school has some IT/networking/programming courses. Those are a great place to start. If not, it's no big deal -- just focus on doing cool projects in your free time and you'll learn this stuff without a problem. Examples: host a voice chat server (mumble/murmur) for gaming with friends. Set up a WordPress blog for a friend or family member who needs a site. Set up mattermost for modern text chat with friends or for a community project (software or otherwise) you care about. Get involved in the communities for the software and projects that interest you. Those are your best bets for learning new skills, staying motivated, and finding mentors. Have fun!
@kafeltz
7 жыл бұрын
you can study this anywhere where there is linux installed, you don't need the author permission.
[shampad@localhost /] my Centos terminals looks like that ....how can I go to terminals and practice these commands ??
@tutoriaLinux
7 жыл бұрын
I'm not sure that I understand your question. If you have a terminal open and you see the shell prompt that you posted in your comment, then you're ready to start typing commands.
My IP adress is same with you.Cool!
5:39 not sure how he exited the top command lol
@HimanshJainYTube
3 жыл бұрын
Ctrl + c
Ew an unriced i3