Top 10 Linux Commands Beginners Should Know: As Analysed from my Bash History of 30 thousand lines

Illustration of a young child focused on a mobile device with a toy penguin nearby, sitting at a table with crayons scattered around. Illustration of a young child focused on a mobile device with a toy penguin nearby, sitting at a table with crayons scattered around.

During pair programming session with one of the mkdev trainees, I noticed that he is not using Terminal much. He would jump between different open windows, file browser and so on. This seemed very inefficient to me, because it took him 10 times longer to do even basic things. I decided to write this article for him and for anyone else who has recently started with programming.

If you feel comfortable using Terminal, then this article will be way too basic for you.

Two notes before we start:

First of all, there is nothing wrong with using graphical clients. But I do believe that being efficient in Terminal is very important for day to day work, regardless which other tools you are using to be productive.

And the second note is that all the commands I will show work more or less the same on both Linux and MacOS, though MacOS might have subtle differences in how you should use these commands.

To write this article, I did not want to speculate and just come up with commands I feel are important. Instead, I took my actual bash history from all the laptops I have and analysed it with a tiny Ruby script. The data set I had includes almost 30 thousand command executions, which should be enough to understand what I really use on a daily basis.

I dropped some of the commands, like kubectl or Terraform, because this is not something beginners start using immediately.

Keep in mind, that there are many utilities that did not make it to the list simply because I do not use them every day.

If you want me to write an article about less common but still important commands, please tell in the comments section.

Now, without further ado, let's see which are the most basic commands you have to know.

Commands are sorted by how often I personally use them, according to the aforementioned script.


The most popular command in my shell history appeares to be git.

I did try to use multiple graphical git clients, like Source Tree or GitHub App, but I always found it much easier to just use the git cli.

Even if you still prefer to use one of the clients I mentioned, I believe it's still beneficial to learn how to use git on the command line.

At very least you have to know basic things like creating commits, branches and working with remote repositories.


The second command in my list is cd.

You should be able to navigate the file system quickly and cd is the primary command to do that.

Learn simple things like quickly going one directory up or switching to your home directory. And don't forget to use TAB to get a quick list of possible destinations.


The third command is grep

grep searches inside files.

I tend to use grep a lot. For me this is the fastest way to find something.

I also use it for filtering the log output for the values I need and for various minor automation tasks.

You don't have to memorize all the possible ways to use grep.

Features I normally are recursive search in a directory, filtering the output of a command by piping it and doing reverse search.

You can do more advanced searches if you'd like, but for the daily work the features I mentioned should be enough.


The next command is ls.

Inspecting files and directories is always important. ls is for listing them.

Most often I would run ls with -lha arguments, so that it gives me all the details about permissions, ownership, file size and symlinks.

When I need to debug SELinux issues, I would add -Z option, so that ls also shows me SELinux labels


The fifth command is vim.

There is a dedicated video about how I use vim with some tips how to use it productively. Vi and Vim are normally available on any system, so it makes sense to learn the basics of this text editor. At very least, learn how to save and exit files.


Command number six is cat.

cat is for viewing the contents of the files. It's the fastest way to see the complete text file in the terminal. For larger files I normally use less, because it allows to search inside the file and scroll through it page per page.


The next command is ssh

It depends on the nature of your work, but knowing ssh never hurts.

Chances are, you will be logging into servers, even if it's just local virtual machines. Knowing how to use ssh, as well as scp and different authentication mechanisms they provide is essential if you do anything with infrastructure.


Command number eight: mv.

mv moves files and directories. You will have to move files and directories frequently and for programmers it's normally faster to do it via Terminal than via File Manager.


Command number nine is cp.

cp copies files and directories.

Again, you will have to use it more or less daily, unless you feel like going to File Manager every time you need to make a copy of anything.


And the final command in my list is curl. curl is a cli to make network requests, most commonly http and https.

It's an essential tool to debug any kind of endpoints, APIs, remote locations, local servers, SSL connections and what not.

It's also the go to tool to automate downloading files, making some requests and so on.

curl has a great number of features, but if you learn at least curl -v -L, you will be on the right track.

And that was the top 10 most popular commands as retrieved from my shell history.

Most of them are very very basic, but as I figured, beginners might not know them or not appreciate them enough.

If you want me to write an article about the commands that are used much less frequently, but are incredibly useful, please leave a comment below.

Here's the same article in video form, so you can listen to it on the go: