PROGRAM ZERO 18-month live AI, LLM & full-stack programme · ₹5,999 for all 18 months · Starts 9 January 2027
Explore Program Zero →
Careers Ninza — business and startup leadership training
JOIN ZERO NINZA KIDS
JOIN ZERO NINZA KIDS
Careers Ninza
SOFTWARE 10 min read · Updated 24 September 2026

Linux command line basics every developer needs

The commands you will actually use: moving around, working with files, permissions, pipes and grep, processes and ports, packages and SSH, plus the safety habits that prevent disasters.

CN
Careers Ninza engineering faculty
Careers Ninza · Kolkata, India

The Linux command line lets you control a computer by typing commands instead of clicking, and most servers, cloud machines and developer tools run on it. Every developer needs a core set: moving between folders, managing files, reading permissions, combining commands with pipes, searching with grep, managing processes, installing packages and connecting to servers with SSH.

You do not need to memorise hundreds of commands. About twenty-five cover most daily work. This guide explains them in the order you will need them, with examples to try, and ends with the habits that keep you from deleting the wrong thing.

Why do developers need the terminal?

—Servers run Linux. Most web servers and cloud machines do, and they usually have no graphical interface at all.
—Tools live there. Git, package managers, build tools, Docker and deployment scripts are all used from the terminal.
—It is faster. Renaming 200 files, searching a large log or restarting a service takes one line.
—It is automatable. Anything you type can go into a script and run on schedule.

How do you get a terminal?

On Linux and macOS, open the Terminal app; macOS uses a very similar Unix command line. On Windows, the easiest route is the Windows Subsystem for Linux, which runs a real Linux environment inside Windows; Microsoft’s WSL installation guide walks you through it.

How do you move around?

The terminal always has a current folder, called the working directory. These commands let you see where you are and move:

pwd                 # print where you are
ls                  # list files
ls -la              # list all files, including hidden ones, with details
cd projects         # move into a folder
cd ..               # move up one level
cd ~                # go to your home folder

Press Tab to auto-complete file and folder names. It saves typing and prevents typos, and it is the single most useful habit to build early.

Which commands work with files?

CommandWhat it doesExample
mkdirCreate a foldermkdir -p app/src
touchCreate an empty filetouch notes.txt
cpCopycp config.example .env
mvMove or renamemv old.py new.py
rmDelete (no recycle bin)rm temp.log
catPrint a filecat README.md
lessRead a long file page by pageless server.log
head / tailFirst or last linestail -f server.log

tail -f deserves a special mention: it follows a log file live as new lines are written, which is how you watch a server while testing it.

What do file permissions mean?

Run ls -l and you will see strings such as -rwxr-xr--. After the first character, they come in three groups of three: permissions for the owner, the group and everyone else. r is read, w is write and x is execute.

chmod +x deploy.sh        # make a script executable
chmod 600 secrets.env     # only the owner can read and write
sudo apt update           # run a command as administrator

Use sudo only when a task genuinely needs administrator rights, and read the command before pressing Enter. Never paste commands from the internet with sudo unless you understand exactly what they do.

How do pipes, redirection and grep work?

The real power of the command line is combining small commands. The pipe | sends one command’s output into another. Redirection > writes output to a file, and >> appends to it. grep searches text.

grep "ERROR" server.log                    # lines containing ERROR
grep -i "timeout" server.log | wc -l       # count them, ignoring case
grep -rn "API_KEY" src/                    # search a whole folder, with line numbers
ls -la > files.txt                         # save a listing to a file
history | grep git                         # find git commands you ran earlier

Once pipes click, you start seeing everyday tasks as small chains of commands.

How do you manage processes and ports?

Every running program is a process. When a server will not start because “the port is already in use”, these help:

ps aux | grep node         # find running node processes
top                        # live view of CPU and memory (q to quit)
kill 12345                 # stop a process by its ID
ss -tulpn                  # see which ports are in use (Linux)

Press Ctrl+C to stop the program currently running in your terminal.

How do you install software and reach servers?

Linux distributions install software through package managers. On Ubuntu and Debian, that is apt:

sudo apt update
sudo apt install git curl

SSH lets you open a terminal on a remote machine securely, which is how you manage cloud servers:

ssh-keygen -t ed25519            # create a key pair once
ssh [email protected]          # connect to a server
scp report.csv [email protected]:~/   # copy a file to it

Use SSH keys rather than passwords, and never share your private key file.

Can you automate tasks with scripts?

Any sequence of commands can become a shell script. Save this as backup.sh, make it executable, and run it:

#!/bin/bash
# Back up the project folder with today's date
tar -czf "backup-$(date +%F).tar.gz" ~/projects/my-app
echo "Backup done"

Small scripts like this are the start of the automation that DevOps and MLOps are built on. Program Zero’s explainer on what MLOps is shows where these skills lead when models go into production.

How do you find files and check disk space?

Two situations come up constantly: “where is that file?” and “why is the disk full?”. These commands answer both:

find . -name "*.log"            # find log files below the current folder
find . -name "*.py" -mtime -1   # Python files changed in the last day
df -h                           # free space on each disk, human-readable
du -sh *                        # size of each item in the current folder

On servers, full disks are a common cause of mysterious failures: databases stop writing, uploads fail and logs vanish. Running df -h early when something breaks often saves an hour of guessing. If du shows a huge logs folder, the fix is usually log rotation rather than deleting files by hand.

Environment variables are the other thing worth knowing early. echo $PATH shows where the shell looks for programs, and export NAME=value sets a variable for the current session. Many “command not found” errors are really PATH problems.

Which safety habits matter most?

—Run pwd before deleting anything, and ls the files you are about to delete.
—Be extremely careful with rm -r and never run it with sudo on a path you have not checked.
—Keep important work in Git, so a mistake is recoverable.
—Read scripts before running them, especially ones piped from the internet.

For a structured, free reference, William Shotts’s book The Linux Command Line is excellent, and the GNU Coreutils manual documents the standard commands in detail. Once you are comfortable here, our guide to Git and GitHub for beginners is the natural next step.

The command line is where Program Zero begins: Phase 0 covers how computers work, Linux fundamentals, the command line and bash scripting, Git and how the internet works, before any programming language.

Want to learn this live, with mentors?

Program Zero starts from the ground up, with Linux, the command line and Git, then builds to full-stack development and AI over 18 months of live, mentor-led classes. ₹5,999 for all 18 months; the batch starts 9 January 2027.

Frequently asked questions

Which Linux commands should a beginner learn first?+

Start with pwd, ls, cd, mkdir, touch, cp, mv, rm, cat and less for moving around and handling files. Then learn grep, pipes and redirection for searching and combining output, chmod for permissions, ps and kill for processes, and ssh for connecting to servers. About twenty-five commands cover most daily developer work.

Do I need to install Linux to learn the command line?+

No. macOS has a very similar Unix command line in its Terminal app. On Windows, the Windows Subsystem for Linux runs a real Linux environment inside Windows, which is the easiest way to practise without replacing your operating system. Cloud notebooks and virtual machines are other options.

What is the difference between Linux and bash?+

Linux is the operating system kernel, and a Linux distribution such as Ubuntu is the full system built around it. Bash is a shell: the program that reads the commands you type in the terminal and runs them. Other shells exist, such as zsh, but the basic commands work in almost all of them.

Is the Linux command line still useful with modern tools and AI assistants?+

Yes. Servers, containers, cloud machines, Git and most developer tools are still operated through the command line. AI assistants can suggest commands, but you need to understand them to judge whether they are safe and correct, especially for commands that delete files or run with administrator rights.

Related reading

We teach this, live

Every article here comes from something we teach. Sit in on a free masterclass and judge the mentors yourself.