Linux Basics Summary — Command Cheat Sheet
Cross-organize the Linux basics commands — navigation, creating, operations, viewing and searching, permissions, processes, and vi — by category with diagrams and cheat tables as a starting point for review.
An Overview of the Commands You Learned in Linux Basics
This page isn't a browser exercise; its purpose is to list and organize the basics commands so far.
It gathers the commands covered in the Linux Basics series onto one page, by category: navigation, creating, operations, viewing and searching, permissions, processes, and editing.
Use the cheat tables to jump back to each article whenever you want to review.
Cheat Sheet — Navigation, Creating, Operations
These are the basic commands for moving around the filesystem, creating directories and files, and copying, moving, and deleting.
This is the group you type most often in day-to-day work.
| Command | Use |
|---|---|
pwd | Show the absolute path of where you are |
ls / ls -l / ls -a | List contents (with details / including hidden files) |
cd /path / cd .. / cd ~ | Move (absolute path / parent / home) |
mkdir name / mkdir -p a/b/c | Create directories (whole hierarchy at once) |
touch file | Create an empty file |
echo 'text' > file | Write to a file (overwrite) |
cp src dst | Copy a file (the original stays) |
mv src dst | Move or rename (the original doesn't stay) |
rm file / rm -r dir | Delete files / directories |
rmdir dir | Delete an empty directory |
Cheat Sheet — Viewing, Searching, I/O
These are commands for viewing file contents, finding the lines you want, and switching where output goes.
Chaining commands with a pipe | lets you combine searching and counting.
| Command | Use |
|---|---|
cat file | Show the whole file |
head -n 5 file / tail -n 5 file | Show the first / last few lines |
wc -l file | Count lines |
grep word file | Find lines containing a given string |
grep -i / -n / -r | Ignore case / with line numbers / recursive search |
cmd1 | cmd2 | Pass one command's output to the next (pipe) |
cmd > file / cmd >> file | Send output to a file (overwrite / append) |
cmd < file | Pass a file as standard input |
cmd 2> file | Send error output to a file |
| Symbol | Effect |
|---|---|
a ; b | Run in order regardless of the result |
a && b | b only if a succeeds |
a || b | b only if a fails |
echo $? | Previous command's exit status (0 = success) |
'...' | Literal characters ($VAR not expanded) |
"..." | Expand $VAR / $(...) to values |
Cheat Sheet — Permissions, Processes, Editing
These are commands for reading and changing file permissions, checking and stopping running processes, and editing text.
They're areas you'll always use in server operations.
On a multi-user production server, permission settings work as access control.
| Command | Use |
|---|---|
ls -l | List with permissions, owner, and size |
chmod +x file / chmod 644 file | Add execute / set permissions in octal |
chown user file | Change the owner |
ps / ps -ef | List running processes |
ps | grep name | Narrow processes down by name |
echo $$ | Show the current shell's own PID |
cmd & | Run a command in the background |
kill PID | End the process with the given PID |
kill -9 PID | Force-quit an unresponsive process |
vi file | Open a file in the vi text editor |
i / a / o | Into insert mode (from the left / from the right / a new line below) |
Esc | Return to normal mode |
:w / :wq / :q! | Save / save and quit / discard and quit |
Nice work!
You now have the basics for operating a Linux server: moving around the filesystem, creating directories and files, copying/moving/deleting, viewing and searching contents, switching input/output, reading and changing permissions, checking and stopping processes, and editing with vi.
Keep this cheat sheet handy, and when you forget a command, go back to the relevant article and actually try it hands-on.
Next, move on to the intermediate level, where you'll combine these to do text processing and write shell scripts.