Skip to main content

Linux Commands Every Beginner Should Learn First

You do not need hundreds of Linux commands to start. About 20 cover most of what a beginner does on a server: moving around, handling files, permissions, processes, networking and installing software. Here they are, grouped by job.

Niraj KafleSaarathi Academy
3 min read
Linux commands to learn first, with the Linux, Docker, Git and AWS logos

Start with about 20 commands. With pwd, ls, cd, cat, grep, chmod, sudo, ps, systemctl, ssh, curl and apt, plus a few more below, you can find your way around a Linux server, read its logs, fix file access, check what is running and install software. Learn them by job, not in alphabetical order.

The terminal is the text window where you type these commands. On a server there is usually no screen and no mouse, so the terminal is all you have. The examples here work on Ubuntu, one of the most common Linux versions for beginners.

Moving around

CommandWhat it does
pwdShows which folder you are in right now.
ls -laLists the files in a folder, including hidden ones, with their owner and size.
cd /var/logMoves you into a folder. cd .. goes up one level, and cd ~ takes you home.

Files and folders

CommandWhat it does
mkdir notesMakes a new folder.
cp a.txt b.txtCopies a file. Add -r to copy a whole folder.
mv a.txt notes/Moves a file, or renames it if you give a new name.
rm a.txtDeletes a file. There is no recycle bin, so check twice.
cat file.txtPrints a short file to the screen.
less file.txtOpens a long file one page at a time. Press q to quit.
tail -f app.logShows the end of a file and keeps showing new lines as they arrive. Good for watching logs live.
grep error app.logFinds every line that contains a word.
find / -name "*.conf"Searches for files by name, starting from a folder you choose.

The | sign, called a pipe, sends the output of one command into the next. For example, cat app.log | grep error shows only the error lines. Pipes are where the terminal starts to feel fast.

Permissions

Every file on Linux has an owner and a set of rights: who can read it, change it or run it. Many beginner errors are really permission errors.

CommandWhat it does
sudoRuns one command as the admin user. Use it only when you need to.
chmod +x script.shChanges a file's rights. This example lets the file run as a program.
chown user:group fileChanges who owns a file.

Processes and services

A process is a program that is running. A service is a program that runs in the background, like a web server.

CommandWhat it does
ps auxLists every running process.
topShows live CPU and memory use, so you can spot what is slowing the machine.
kill 1234Stops the process with that number (its process ID).
systemctl status nginxShows whether a service is running. Use start, stop or restart in place of status to control it.
journalctl -u nginxShows the logs of one service.

Networking

CommandWhat it does
ssh user@serverLogs you in to another computer safely over the network.
ping google.comChecks whether another machine answers at all.
curl -v https://example.comSends a web request and shows the full reply, headers included.
ss -tlnpLists the ports your machine is listening on, and which program owns each one.

Installing software

CommandWhat it does
sudo apt updateRefreshes the list of software you can install.
sudo apt install nginxInstalls a program, here the Nginx web server.

Other Linux versions use other package tools, such as dnf. The idea is the same.

Getting help

Type man and a command name, for example man grep, to read its manual. Most commands also print a short guide with --help. AI tools are good at explaining a command, but try anything they suggest on a practice machine first, never on a live server.

How to practise

Reading this list will not make the commands stick. Typing them will. Set up a free practice machine: WSL on Windows, a virtual machine, or a small cloud server. Then give yourself small tasks. Find every error in a log. Make a script and let it run. Install Nginx and check that it is listening on port 80.

Do a little every day. After a couple of weeks, most of these commands will come without thinking.

Where we teach Linux

We teach Linux inside three courses: Cloud Computing & DevOps, Cybersecurity & Ethical Hacking and Backend Engineering. Our Linux training page explains what each one covers and how to choose.

Frequently asked questions

Do I need to install Linux to practise these commands?

Not as your main system. On Windows you can use WSL, which runs Linux inside Windows. A virtual machine or a small cloud server also works, and the macOS terminal knows most of these commands too.

Which Linux should a beginner start with?

Ubuntu is a common choice because it is widely used on servers and easy to find help for. Security learners often use Kali Linux, which is built for security testing.

Do I have to memorise every option?

No. Learn what each command is for, and look up the options with man or --help when you need them. The ones you use often will stick on their own.

Is the terminal hard for a complete beginner?

It feels strange for the first few days because there is nothing to click. Once you know the commands on this page, most daily server work becomes a matter of practice.

See what the syllabus actually covers.

Every week is published up front. Ten students a batch. Mentors who still do the job.

Course for this topic: Cloud Computing & DevOps