Linux Commands I Use All the Time

preview_player
Показать описание
In this video, I go over Linux commands I use all the time. I will be going over a variety of commands in this video and showing the basics of how I navigate the Linux terminal. .

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

I love the terminal too, although I'm far from an expert. One of my favourite features is ”!!”.
Let's say you are trying to do something and enter a long commands line, only to find that you don't have permission to run it. Then just type ”sudo !!” and it will run the last commands again with sudo. Saves time! Yes, I know that you can hit the up arrow key and then ctrl+a sudo <space> <enter>, but the double exclamation marks are more elegant, I think.

johnnyrosenberg
Автор

Rather than give a specific command, I'll give a recommendation for my favorite book for learning all of these commands... Linux in a Nutshell. It's like having all of the man pages for all of the basic commands for Linux shells in one dead-tree place. It makes a great reference if you just pick it up for 5-15 minutes at a time and randomly pick a command to scope out.

robgibson
Автор

Chris: Hey honey, can I get a sandwitch?
Wife: NO
Chris: sudo make sandwitch

TheWilldrick
Автор

Top tip: If you like ls -l by default you can define aliases, for example I have mine set as

alias ls="ls --color=auto -lrt"

so now I get a default long listing when using ls, in colour, and time reverse order, i.e most recent items appear at the bottom.
Put it in your login profile to automatically set it every login, for bash that is .bash_profile and Bob's uncle. :D

afborro
Автор

I love the way you mispronounce "tilde" (til-duh) as "tidely".

kevinklement
Автор

Couple additional things:


tar can handle multiple formats beyond .tar.gz -- at the very it also supports .tar.bz2 and .tar.xz (and of course just regular .tar files). Generally speaking there is a probably a way to handle it directly with tar if you see a file with tar in it.


tar also assumes the first parameter are your arguments, so if you were decompressing one of the above file types, you could actually do "tar xpf" instead of "tar -xpf" and you'd have the same behavior. Not a huge thing but you don't actually need to include the dash in your parameters.


This might be more of a shell thing than necessarily a command, but ! is super useful.


If you have a situation where you need to use root permissions to do something with sudo, but you forgot to actually use sudo, you can use !! to recall the previously called command -- then you can prepend sudo to that to call your previous command with sudo prepended without having to type out the entire command out again with "sudo !!"



Similar to Chris's "mkdir junk" example, if I tried to create a folder in my root /home directory as a normal user:

/home $ mkdir newfolder
mkdir: cannot create directory ‘newfolder’: Permission denied


Then I can just re-run that previous command with sudo prepended to it:


/home $ sudo !!
sudo mkdir newfolder
Password:
/home $ ls
chris newfolder


You can also recall earlier commands using ! in conjunction with the history command. I use gentoo, so if I tried to do an install earlier in the day that didn't work since I wasn't running it as root, I could use a similar syntax to rerun a different command as root:


56 emerge -pv fcitx-qt5 mozc kcm-fcitx
57 emerge -av fcitx-qt5 mozc kcm-fcitx
58 emerge -av fcitx-qt5 mozc kcm-fcitx
sudo emerge -av fcitx-qt5 mozc kcm-fcitx
(can begin install process now)


You could also do the same thing with the su -c command if for some reason you didn't have sudo available, but it's probably a bit more complicated to use it that way:
/home $ rmdir newfolder/
rmdir: failed to remove 'newfolder/': Permission denied
/home $ su -c "!!"
su -c "rmdir newfolder/"


You'll need to put what you're trying to run in quotes, otherwise it's just going to interpret the "rmdir" (with no arguments) as your command and that you want to run it as the "newfolder" user:
/home $ su -c !!
su -c rmdir newfolder
No passwd entry for user 'newfolder'

vacant
Автор

Thanks Chris for the video. There were a couple there I needed reminding of.
One thing I've read in every text and video I've watched on the subject is only to use the Root user when you have to, as you can seriously fry your system with a mistyped command for which there is no coming back from. Do your stuff as Root and exit out when done.

busdriver
Автор

Chris, you're a great source of inspiration. Thank you so much for all the knowledge you share!
Greetings from Argentina :)

andresskl
Автор

Another great intro video Chris! CLI is so efficient and it 95% of my sysadmin job. I love bash-it, IMHO a great addition to any terminal. I use it with Terminator and my "triple terminal" preset! I love listening to people that share their tips and tricks, what they like and what they use. I continue to learn everyday... after 29 years in the business! And i LOVE Linux and all it offers! You made me want to try Arch Linux, i'm a RHEL/CentOS sysadmin. I use Ubuntu on my laptop...not by choice as i don't like it that much but it does the job... Anyway for me, anything but Winblows and Macs! Keep up the good work!

guyboisvert
Автор

Great stuff, Chris! I've been digging your channel for the past year, and have really learned a lot. I just made Arch Linux my daily driver a couple of months ago and have jumped on the YouTube bandwagon with my own channel. I hope there's room for my voice in the Linux community. Thanks for your voice and inspiration.

FairlyBasicTech
Автор

Be aware: Terminal *is* case sensitive, HELLO does not equal hello.

digitalsparky
Автор

btw cd without arguments takes you to the home directory :p

fuseteam
Автор

Yes, I was scared of the Linux terminal for a long time, but now I can handle some tricks. Thanks Chris!

lasc
Автор

Sometimes I feel like I am the only person reading them but man...
man is the best command in all Unix like systems. There is such a huge amount of information on just about any command line program older than a year

dergenie
Автор

Damnit! This is one of the best video in 2019. This is just great! Thank you Chris.

tpasiUG
Автор

My favorite command would have to be "sudo !!"
Very useful if you type in a long command and forget to put sudo in front of it.

ewancox
Автор

some additional commands I use: killall, lsof, grep (in combo with many commands), shutdown, service, man, more, ping, netstat, and when you are all done, 'exit'. ;-)

PhilosopherRex
Автор

You spoke about permissions (user/owner, group and GUEST). Actually, it's for anyone other than owner user or users who are in the group.

monksuu
Автор

The command I have fallen in love with is rsync -av --progress. I have been reading, watching youtube videos, trial and error, trying to figure the command line out. I just want to take a moment to thank Microsoft from the bottom of my heart for helping me to discover and learn to appreciate the Linux command line! 😅

davidjeter
Автор

Being a newbie to Linux, your videos have been most helpful. 👍🏾

jamescarson