The Linux command line is a text interface where you type commands to run programs, manage files, and automate tasks instead of clicking through menus. It rewards a short vocabulary, because a dozen core commands cover most day-to-day work and chaining them with pipes multiplies what you can do. This guide takes you from opening a terminal to the essential commands, file operations, permissions and sudo, piping with grep, and shell customization, so that by the end you can work without touching a mouse.
I verified the command syntax and examples directly against Ubuntu's official command-line tutorial and cross-referenced them with DigitalOcean's 50+ essential commands guide. The details hold up across both: the Ctrl-Alt-T shortcut, the user@host:folder$ prompt, the core navigation and file commands, chmod permission syntax, and the pipe and redirect operators all match.
Key Takeaways
- Press Ctrl-Alt-T to open a terminal on Ubuntu. The prompt shows your username, host, and the folder you are in, which you can read with
pwd. - A handful of commands does most of the work:
ls,cd,pwd,mkdir,touch,cp,mv,cat,rm, andfind. - Prefix a command with
sudoto run it with administrator rights. It asks for your password once and caches that approval for about fifteen minutes. - Send one command's output into the next with the pipe symbol
|, and save results to a file with>. - Switch from the default Bash shell to Zsh with the Oh My Zsh framework for faster typing and a more comfortable prompt.
Introduction: Why the Command Line Is Worth Ten Minutes
The command line is a text-based interface where you type a command and the system runs it. Three related words cover most of the terminology you will meet. The terminal is the window you open, which in GNOME is GNOME Terminal. The shell is the program running inside it, usually Bash. The command line is the text interface itself. Press Ctrl-Alt-T and a terminal opens, starts a shell, and hands you a prompt to type at.
Why bother when you have a GUI? Mostly because of servers, which usually have no graphics layer, so the terminal is the only way in. A command that repeats a task takes seconds where a click-by-click sequence takes minutes, which is how boring work quietly gets automated. It is also a skill people hire for in development, DevOps, and sysadmin roles. None of this means memorizing hundreds of commands. It means learning a handful and combining them. On Ubuntu the terminal is built in, and the same commands work across most distributions, from the standard desktops to Kali Linux's security tooling, which is built around the command line.
Essential Commands
Open a terminal and read the prompt first. It usually looks like this:
user@host:~/projects$
That is your username, your host, the folder you are in, and the prompt symbol. A $ means you are a normal user; you would see # instead if you were root. From here the first batch of commands answers where you are and what is around you. pwd prints the working directory, ls lists what is in it, and cd changes to another folder. These are the ones to have at your fingertips:
pwd # print the current folder
ls # list the files here
ls -la # list everything, including hidden files
cd ~/projects # move into a folder
cd .. # go up one level
cd # return to your home folder
man ls # open the manual page for a command
Two beginner traps cost most people the same pain. Commands are case-sensitive, so PWD and pwd are different things and the first one does not exist. And the words shell, terminal, and console are used loosely to mean roughly the same idea, which is why the same thing goes by several names. If you learn better by watching, freeCodeCamp's two-hour command-line course walks through these basics and more on video.
File Operations
Create, move, copy, delete, and find. Make a new folder with mkdir and an empty file with touch:
mkdir projects
touch projects/notes.txt
Copy with cp and move or rename with mv. Moving is also how you rename, so mv old.txt new.txt renames in place without copying. DigitalOcean's 50+ commands guide lays out the full family, but one deserves a warning. rm deletes without asking and there is no undo. A rm -r folder wipes an entire tree, so develop the habit of typing ls right before any rm. To locate a file the GUI will not find, reach for find:
find ~ -name "*.jpg" # every JPG under your home folder
find /etc -name "profile*" # find a config file by name
Hidden files start with a dot, like .bashrc, and a plain ls skips them. Add the -a flag to see them.
Permissions and sudo
Every file carries three permissions, read, write, and execute, split across the owner, the group, and everyone else. ls -l shows them as r, w, and x in groups of three. You change them with chmod, either symbolically or with a three-digit number:
chmod +x script.sh # make a script executable
chmod 755 script.sh # owner rwx, group and others rx
In 755 the 7 is read plus write plus execute for the owner, and each 5 is read plus execute for everyone else. Use chown user:group file to change who owns a file.
For anything that touches the system, prefix the command with sudo, which runs it with administrator rights and asks for your password once, then caches that approval for about fifteen minutes. The sudo section of Ubuntu's official tutorial covers the reasoning. Keep two habits. Read what you are about to run, and avoid sudo su, which drops the whole session into root instead of elevating one command at a time.
Piping and Grep
Pipes are the reason the command line scales. Each tool does one job well, and you link them with the pipe symbol so that one command's output becomes the next one's input.
ls /etc | wc -l # count the entries in /etc
cat log.txt | grep error # show only the lines that say "error"
grep searches text, and it is the tool you reach for when a log file is too big to read. The vertical bar sits next to the spacebar, not on the number row, which is where most beginners first get tripped up. Redirection works the same idea in one direction: > writes a result to a file and overwrites it, while >> appends to the end.
ls /etc > filelist.txt # save the list to a file
echo "done" >> filelist.txt # add a line to the end
You can chain these into real workflows, which is exactly the kind of thing automating Office documents from the terminal shows, turning a folder of files into a batch job. When you do not know a flag, read the manual page with man command. William Shotts' free book The Linux Command Line spends its first part on precisely this, which is why it is still the best free deep dive.
Shell Customization
Most systems ship with Bash, but Zsh has grown fast and is worth a look in 2026. Install it with sudo apt install zsh and switch to it with chsh -s $(which zsh). The Oh My Zsh framework makes Zsh pleasant out of the box, with themes, plugins, and instant tab completion, and it is the most common starting point, with hundreds of thousands of stars on GitHub. Its Powerlevel10k theme gives you a fast, informative prompt, and you tune everything in a file called ~/.zshrc. If your interest is more in letting AI do the typing, see how GitHub Copilot's terminal capabilities fit into a shell workflow.
Conclusion
My read: the command line is less about memorizing commands and more about composing them. Learn ten things and pipe them, and a tool that felt small starts doing work you would otherwise have scripted a whole program for. Start with the navigation and file commands in a real terminal, type each one so you feel it, and add grep and pipes once you are comfortable. Expect Zsh plus Oh My Zsh to become the default for anyone who lives in a terminal, and expect AI assistants to keep closing the gap between "I need to look this up" and "it just did it."
What command got stuck in your head the first time you opened a terminal? Share it in the comments, or ask a question and I will walk you through it.
{
"@context": "https://schema.org",
"@type": "FAQPage",
"mainEntity": [
{
"@type": "Question",
"name": "What is the difference between the terminal, the shell, and the command line?",
"acceptedAnswer": {
"@type": "Answer",
"text": "The terminal is the window or app you open, such as GNOME Terminal. The shell is the program running inside it, usually Bash. The command line is the text interface itself where you type. People use the three words loosely, but they point to different layers."
}
},
{
"@type": "Question",
"name": "How do I open a terminal in Linux?",
"acceptedAnswer": {
"@type": "Answer",
"text": "On Ubuntu press Ctrl-Alt-T, or search for Terminal in your applications menu. A terminal opens and starts a shell, usually Bash, ready for you to type commands."
}
},
{
"@type": "Question",
"name": "What is sudo and when should I use it?",
"acceptedAnswer": {
"@type": "Answer",
"text": "sudo means superuser do. It runs a command with administrator rights, asks for your password once, and caches that approval for about fifteen minutes. Use it when a task needs system-level changes, such as installing packages or editing files in /etc."
}
},
{
"@type": "Question",
"name": "How do I navigate directories without a mouse?",
"acceptedAnswer": {
"@type": "Answer",
"text": "Use cd to move to a folder, pwd to show where you are, and ls to list what is inside. cd .. goes up one level and cd by itself returns to your home folder."
}
},
{
"@type": "Question",
"name": "What are pipes and why are they useful?",
"acceptedAnswer": {
"@type": "Answer",
"text": "The pipe symbol | sends the output of one command into the input of the next, so small single-purpose tools combine into complex work. For example, ls /etc | wc -l counts the entries in /etc. Related, > writes a result to a file and >> appends to it."
}
}
]
}
Frequently asked questions
What is the difference between the terminal, the shell, and the command line?
The terminal is the window or app you open, such as GNOME Terminal. The shell is the program running inside it, usually Bash. The command line is the text interface itself where you type. People use the three words loosely, but they point to different layers.
How do I open a terminal in Linux?
On Ubuntu press Ctrl-Alt-T, or search for Terminal in your applications menu. A terminal opens and starts a shell, usually Bash, ready for you to type commands.
What is sudo and when should I use it?
sudo means superuser do. It runs a command with administrator rights, asks for your password once, and caches that approval for about fifteen minutes. Use it when a task needs system-level changes, such as installing packages or editing files in /etc.
How do I navigate directories without a mouse?
Use cd to move to a folder, pwd to show where you are, and ls to list what is inside. cd .. goes up one level and cd by itself returns to your home folder.
What are pipes and why are they useful?
The pipe symbol | sends the output of one command into the input of the next, so small single-purpose tools combine into complex work. For example, ls /etc | wc -l counts the entries in /etc. Related, > writes a result to a file and >> appends to it.
References
- Ubuntu: The Linux command line for beginners (Canonical, official tutorial)
- DigitalOcean: 50+ Essential Linux Commands, a comprehensive reference (April 2026)
- freeCodeCamp: Linux Command Line full course (YouTube)
- Oh My Zsh: the Zsh customization framework
- The Linux Command Line by William Shotts (free Creative Commons book)
Top comments (0)