Most Linux system administrators spend their days at the command line, configuring and monitoring their servers through an SSH session. The command line is extremely powerful, but it can be difficult to keep all the options switches and tools in your head. Man pages are only a command away, but they’re often not written for quick consultation, so when we’re stuck for some of the more arcane options, we reach for the collection of cheat sheets that we’ve curated over the years.
Even command line masters occasionally need a litte help, and we hope that terminal beginners will find these concise lists useful too. All of these tools are installed by default on a standard Linux box except for Vim and Emacs, which may or may not be available (see the package manager cheat sheets for how to get them).
Server Management
SSH is the standard tool for connecting securely to remote servers on the command line. (We hope you aren’t using Telnet.)
Screen is a must-have application for those who SSH into multiple servers or who want multiple sessions on the same server. Somewhat akin to a window manager for terminals, screen lets users have multiple command line instances open within the same window.
Bash is the default shell on most Linux distributions (except Ubuntu, but Dash is almost completely compatible). It’s the glue that holds together all the other command line tools, and whether you’re on the command line or writing scripts, this Bash cheat sheet will help make you more productive.
Cron is a tool for scheduling tasks. The notation is simple but if you don’t use it a lot it’s easy to forget how to set it to the right times and intervals.
Writing and Manipulating Text
Vim is a powerful editor, and you’ll find it or its older brother Vi on most Linux systems. Vim has a modal interface that can be a bit daunting for newcomers, but once you get to grips with how it works, it’s very natural.
Emacs is a text editor that throws the “do one thing well” philosophy out of the window. The range of things that Emacs can do is seemingly endless, and a good cheat sheet is necessary for getting to grips with its finger work-out keyboard commands.
As a bonus for the Emacs users out there: check out Org mode. It’s a flexible plain text outliner that integrates with Emacs and can be used for planning, to-dos, and writing.
Getting to grips with grep is essential if you deal with a lot of text files (as almost everyone managing a Linux server will).
Together Sed and Awk can do just about anything you might want to do with a text file.
Package Management
RPM
Distributions that use RPM for package management, including Fedora, RHEL, and CentOS have a couple of tools to choose from:
Yum for high-level package management, and the
RPM tool itself for manipulating and querying the package database at a lower level.
Deb Package Management
Debian-based distros like Ubuntu and its derivatives use “
apt-get” for general package management, and “
dpkg” for direct manipulation of debs.
Cheaters
If you’re a regular user of cheat sheets and manage your servers from a Mac, you might want to take a look at Brett Terpstra’s cheat sheet app.
Cheaters is a collection of scripts that will display an Automator-based pop-up containing a configurable selection of cheat sheets.
Check out the instructions on his site to find out how to integrate the cheat sheets we’ve covered in this article with Cheaters.
Check out the latest post
Other articles
Thanks! Also for Bash, CTRL+C (Ubuntu) will stop a program. So say you accidentally ran a Ping without telling it to stop; CTRL+C will stop the program.
some more interesting commands about screen.
screen:
CTRL-a n — next screen
CTRL-a p — previous screen
@Mike Frett, CTRL-c is a signal named as SIGINT. you can see all signals by executing `kill -l`. SIGINT means interrupt from keyboard.
Wow this is just wrong in so many places that I don't even know where to start…. Seriously the SSH cheat sheet and not even a single SSH-command?
How about the little seen 'cd -'.
Try it to see what it does. You'll like it.
Is everyone aware that clicking on the links actually brings up the full sheets. The actual article shows a few commands whilst linking to the actual sheets.
Thanks for pointing that out. I didn't even realise there were links there. 🙂
yeah ssh cheat sheet is actually a command cheat sheet.
To repeat the last argument of your last command in bash enter escape+period. Very handy.
Nice… i'm going to add networking commands, Linux and more!!!! 😀
"Bash is the default shell on most Linux distributions (except Ubuntu, but Dash is almost completely compatible)" is totally incorrect. Both Debian and Ubuntu default to having /bin/sh be a symlink to /bin/dash (so any script that uses /bin/sh actually uses /bin/dash rather than /bin/bash). The default shell for root, admin users, and regular users is /bin/bash!
For those sysadmins that are just starting out, or mostly admin Windows machines but ocassionally have to mangle linux here is a cheat sheet for basic commands: http://linuxtutorial.todolistme.net/cheatsheet.php It also contains links to a full tutorial so if you need more information on any section it is right there.