DEV Community

Cover image for Linux Terminal: The Ultimate Cheat Sheet

Linux Terminal: The Ultimate Cheat Sheet

Mauro Garcia on January 25, 2021

If you're a Linux user, the Terminal is probably the most powerful tool you would ever have. But the thing about the Terminal is that you need to l...
Collapse
 
robertseidler profile image
RobertSeidler

Good overview!

For people who are used to using nano, I recently came across this editor: micro

It's in a similar vein as nano, in terms of simplicity, but with modern features like mouse-support, integrated terminal-emulator (and fitting splits).

I can only recommend you try it :D

Collapse
 
cannuhlar profile image
Can Nuhlar

I was afraid of using vim and instead used nano for almost 3 years. Changing to vim changed my workflow A LOT! I'd really suggest that new comers try to familiarize with vim. You don't have to be power user just Insert & save & quit commands would do fine. When you feel comfortable enough with terminal just switch to vim completely. If you are sshing into servers a lot It'll really make a difference.

Collapse
 
mauro_codes profile image
Mauro Garcia

You're talking with a big vim nerd here! 😄I plan to write about that in the future because it is insanely powerful, and, as you said, you just need to know the basics to use it as a regular text editor.

But I wanted to keep this post centered around the terminal.

Thread Thread
 
cannuhlar profile image
Can Nuhlar

Haha! My reply wasn't to you actually it was against Robert's "micro" suggestion, very good post keep up the good work! I'd really like to see an advanced Vim post here btw. :D

Collapse
 
robertseidler profile image
RobertSeidler

I'm still afraid of using vim xD

Not knowing the quit-command in vim, is a beginners nightmare that can scar you. Someday I'll might look into vim aswell, I hear a lot of good things about it :D

Thread Thread
 
mauro_codes profile image
Mauro Garcia

I’ve been there! Once you learn the basics, it’s addictive to keep learning. But there is a lot of hate/love around Vim. Is not for everyone.

Collapse
 
mauro_codes profile image
Mauro Garcia

Thanks for your comments, Robert! I didn't hear about micro, but it looks amazing!! I will definitely try it!

Collapse
 
bogkonstantin profile image
Konstantin Bogomolov

Try also Ctrl + R and type part of the used command. Insteat of the history command.

Collapse
 
cannuhlar profile image
Can Nuhlar

I was here to write the same comment. Reverse searching is awesome!

Collapse
 
mauro_codes profile image
Mauro Garcia

I didn’t know about that one! Thanks for sharing, Konstantin!

Collapse
 
samuelabreu profile image
Samuel Abreu

Useful shortcuts i like:
ctrl + p: Replace [up], last command
ctrl + a: Replace [Home], go to beginning of the line
ctrl + e: Replace [End], go to end of the line
ctrl + f: forward one char
ctrl + b: backward one char
ctrl + w: Deletes one word
esc + f: forward one word
esc + b: backward one word

Useful to who uses keyboard without arrows or just dont wanna move hands.

Collapse
 
mauro_codes profile image
Mauro Garcia

Thanks for your feedback, Samuel. I didn't know about those shortcuts. They are messing with my head because I'm used to hitting "ctrl + w" and "ctrl + b" to move backward and forward in vim 😂

Collapse
 
zerolife profile image
Andrew Abraham

Don't forget
ctrl - r : Search history for command

Collapse
 
bradnichol profile image
Bradley Nichol

My newest favourite History command uses grep and is great for finding a command that you have a faint memory of.

history | grep "keyword"

Collapse
 
zerolife profile image
Andrew Abraham

just use ctrl - r
Does the same thing. :)

Collapse
 
mauro_codes profile image
Mauro Garcia

True! I included the ctrl + r shortcut in my second post about the Linux terminal (which will be published next Monday)

Collapse
 
mauro_codes profile image
Mauro Garcia

I love that approach! Btw, the grep command is one of the many that I decided to add in another post because this one was already too big 😂

Collapse
 
bradnichol profile image
Bradley Nichol

Great stuff, look forward to reading your next mammoth post 😁

Thread Thread
 
fwolfst profile image
Felix Wolfsteller

For most situations, I would prefer searching through the history with CTRL+r (you might consider adding that one), but yes sometimes you want to see the full list.

Thread Thread
 
bradnichol profile image
Bradley Nichol

OK, that's pretty awesome! Thanks for that.

Collapse
 
shwetabh1 profile image
Shwetabh Shekhar

I didn't know about whereis. Highly useful. Thanks for sharing!

Collapse
 
mauro_codes profile image
Mauro Garcia

Glad to hear that it was useful! I'm working on the second part of this post so stay tuned!

Collapse
 
shwetabh1 profile image
Shwetabh Shekhar

Looking forward to it :)

Collapse
 
rigeldeveloper profile image
Jhonathan Andres Mauricio La torre

Good job, thanks for the time invested.

Collapse
 
mauro_codes profile image
Mauro Garcia

You're welcome Jhonathan! I'm planning to release a second part with more commands! Stay tuned

Collapse
 
rigeldeveloper profile image
Jhonathan Andres Mauricio La torre

Im waiting for that

Collapse
 
slavius profile image
Slavius

Ehm, DESKTOP-HIQ7662? That's Windows terminal and Linux shell...

Collapse
 
mauro_codes profile image
Mauro Garcia

You got me! 😄 I was working on Windows with the Ubuntu Terminal while writing this post. Shame on me 😄

Collapse
 
devlorenzo profile image
DevLorenzo
Collapse
 
mauro_codes profile image
Mauro Garcia

Yep of course

Collapse
 
anmshpndy profile image
Animesh Pandey

Ultra useful, thanks Mauro!

Collapse
 
sairamnagothu profile image
SairamNagothu

Awesome post 🎉👏

Collapse
 
mauro_codes profile image
Mauro Garcia

Thanks!

Collapse
 
amirfakour profile image
amir fakoor

whatis and whereis are new for me, thank you.

Collapse
 
mauro_codes profile image
Mauro Garcia

You're welcome! Next Monday, I'll publish the second part of this post!

Collapse
 
foley803 profile image
foley803

Tail for looking at log files or files that are being written to.

Collapse
 
mauro_codes profile image
Mauro Garcia

Super helpful command! I'll probably include tail, head, and less in upcoming posts!

Collapse
 
atluslux profile image
Johnny Outlaw

This is an awesome resource! Thanks for sharing this!

Collapse
 
mauro_codes profile image
Mauro Garcia

You're welcome, Johnny! Glad to hear that it was useful for you! I'm already working on the second part of that post so stay tuned!

Collapse
 
rishabk7 profile image
Rishab Kumar

Great for beginners!

Collapse
 
mauro_codes profile image
Mauro Garcia

Thanks Rishab! I tried to make this post as inclusive as possible. I'll probably add a second part with more advanced commands