Hello Command Line

This is the first day we step into the world of the Linux command line. But why command line? why not just pick up the mouse and just use GUI:

Graphical user interfaces make easy tasks easy, while command-line interfaces make difficult tasks possible

IMO, Basic ability to use the command line is very necessary for most developers.

So, let’s find us a good Linux distribution, and have our hands dirty on some terminal setup tricks so that we get a bird’s view of what the command line is and how to learn it.


There are many versions of Linux, which are called distributions. http://en.wikipedia.org/wiki/Linux_distribution lists many of them, say Redhat, CentOS, fedora, and so on. Ubuntu is one of the most popular ones. It works well on both servers or workstations.

The Ubuntu version we are going to use in our course is Ubuntu 20.04.2 LTS, which was issued in April 2020.


Terminal Setup

When the system boots up, we shall see an interface like this.

We will be needing a software named Terminal to use the command line, it should come with the system. You should be able to find it somewhere. But I am on Mac now, so I will need to open the Terminal on MacOS, then login to my remote ubuntu system, which is the ubuntu I installed on my server.

How To Learn Commands

What we see here is called a shell prompt, it follows a “username@machinename” format.

The tilde symbol here represents the user’s home directory. now the username is peter, the home directory for peter is /home/peter. We will cover more about the home directory and working directory in later episodes.

We are expected to input commands after the dollar sign, if we type sth random, and hit enter, then the error report command not found is shown.

A valid command usually consists of three parts, the command, the parameters, and the operands.

$ ls
$ mkdir ttt
$ rm -r ttt

As a developer, it is often wise not to try to know every detail of a new tool at the beginning. If you want to learn by books, I won’t recommend big books for professionals, tutorials or guides are much more newbie-friendly. For books like this, check http://billie66.github.io/TLCL/, as the next learning material for Linux after this course.

you can use manpage to get more info about one command, for example, if you want to know more about the command rm, type

man rm

type /-r then we can see the description of -r option, type n if you want to find the next match, and q to quit.

If you want to learn a new command, you can search with Google, or you can learn it on Wikipedia or linfo.org.

Now we have a basic understanding of the command line, and let’s call it a day, and see you in the next episode.