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.

A category map of the basics commands
navigatepwd / ls / cdcreatemkdir / touchoperatecp / mv / rmviewcat / head / tailsearchgrep / pipe |I/O> / >> / 2>permissionsls -l / chmodprocessesps / kill / &editvi / i / :wq
Organizes the basics commands into 9 areas: navigate, create, operate, view, search, I/O, permissions, processes, and edit.

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.

The flow: navigate → create → operate
pwd / ls / cdread where you are and movemkdir / touch / echo >create directories and filescp / mv / rmcopy, move, rename, delete
Check where you are and move, create, then go on to copy, move, and delete.
CommandUse
pwdShow the absolute path of where you are
ls / ls -l / ls -aList contents (with details / including hidden files)
cd /path / cd .. / cd ~Move (absolute path / parent / home)
mkdir name / mkdir -p a/b/cCreate directories (whole hierarchy at once)
touch fileCreate an empty file
echo 'text' > fileWrite to a file (overwrite)
cp src dstCopy a file (the original stays)
mv src dstMove or rename (the original doesn't stay)
rm file / rm -r dirDelete files / directories
rmdir dirDelete 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.

CommandUse
cat fileShow the whole file
head -n 5 file / tail -n 5 fileShow the first / last few lines
wc -l fileCount lines
grep word fileFind lines containing a given string
grep -i / -n / -rIgnore case / with line numbers / recursive search
cmd1 | cmd2Pass one command's output to the next (pipe)
cmd > file / cmd >> fileSend output to a file (overwrite / append)
cmd < filePass a file as standard input
cmd 2> fileSend error output to a file
SymbolEffect
a ; bRun in order regardless of the result
a && bb only if a succeeds
a || bb 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.

Roles of permissions, processes, and editing
ls -l / chmodread and change rwx permissionsps / kill / &check and stop processesvi / i / Esc / :wqedit and save text
Organizes three areas: reading/changing permissions, checking/stopping processes, and editing text.
CommandUse
ls -lList with permissions, owner, and size
chmod +x file / chmod 644 fileAdd execute / set permissions in octal
chown user fileChange the owner
ps / ps -efList running processes
ps | grep nameNarrow processes down by name
echo $$Show the current shell's own PID
cmd &Run a command in the background
kill PIDEnd the process with the given PID
kill -9 PIDForce-quit an unresponsive process
vi fileOpen a file in the vi text editor
i / a / oInto insert mode (from the left / from the right / a new line below)
EscReturn 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.