ssh commands cheatsheet

My SSH Commands Cheatsheet

Lately, I’ve been doing a lot of work dealing with servers and I couldn’t help but turn to using SSH to do stuff in order to save time.

Before, I’d really prefer not doing tasks on my web servers via SSH because I did not start making things for the web using the command line. I was not used to it, so I’m kinda not really familiar with all those crazy Linux commands. They’re very intimidating to newbies. But at some point, I was forced to use it and as soon as I was using it, suddenly everything I used to do before, became a lot faster.

For example, before, when I transfer files from one server to another, I used to download the files to my computer and then upload it again to the other server. There was no other way for me to do that using the graphical interfaces provided by hosting companies. But then it gets really troublesome when you’re trying to move huge files and you do it this way. With SSH, you can skip the middleman and do transfers like this directly from server to server. And several gigabytes of files will be a breeze!

You see, SSH is like a shortcut for doing stuff. But I’d say it’s for advanced web admins only, because you really have to get yourself acquainted with the commands you’ll have to run for each specific task you want to get done. But it saves a lot of time, I mean lots of time. Mostly because you never see any graphics, all you see is a bunch of text on pure black background.

That’s the beauty in it, and also the one thing that makes it so intimidating to the weak-hearted. Makes you realize the reason why loser guys are so scared to approach beautiful women, is very much the same to the reason why newbies to web dev are scared to use SSH.

But the only hurdle you really have to overcome is learning how to use it, familiarizing the commands and actually understanding what they do. I was having a little hard time with that. For each simple task I tried to do, I had to google it and look at a few results before I could actually apply it.

So to stop (or at least minimize) the googling and to save time, I’ve compiled a list of these commands and other important notes about SSH’ing. There might be a gazillion similar posts already published out there about this but most of the ones I’ve found are only talking about one or two specific commands. I’ve never come across one that has this exact list.

This is a collection of the commands that I found myself using very often. So here it is for all those who might be looking for this also:

Paste copied text to command line prompt
Create a TAR archive
Extract a TAR archive
Get file or directory size
Delete file
Delete folder & its contents
Copy files from remote location (another server)
Copy file to another folder
Copy file to same folder
Copy whole folder including subfolders
Move file to another directory
Move whole folder and subdfolders
Search for a file
Search for a directory
Search for a specific text inside files
Search for specific files/folders and execute a command on them
Print working directory (current location)
List contents of current directory
Count number of files in current directory & subdirectories
Get the size of a directory and its content
Read/Edit a file
Create a directory
Export MySQL database
Import MySQL database
Check for the status of a command/program (process status)

As you keep using these commands, they sort of stick in your head and then you won't be needing a list like this anymore. But anytime you get stuck, if you can just remember the name of the command, you can just add the --help option to print the available options you can use for that command. That will save you a minute or two compared with going to Google.

Hope you'll find this list handy! Drop me a line below if you did...


People don't really know what they want until they learn about it. Marketing educates people about what they want. I'm a marketer, therefore I'm an educator.