The terminal + Bash give precise control over files, processes, networking, and more. Below are core commands with examples and screenshots.
Commands you type are small programs (e.g., /bin/ls, /bin/cp). The terminal sends your input to the shell, usually Bash (Bourne Again Shell), which parses and executes them.
How a Command Runs
You type a command (e.g., ls -l).
The terminal forwards it to the shell (Bash).
Bash parses the command (syntax, expansions, variables).
It resolves the executable (e.g., /bin/ls) and runs it.
Output is printed back to the terminal.
1) Navigating & Managing Directories
pwd
cd /Documents
mkdir new_folder
rmdir new_folder
ls -la
pwd — print current directory path
cd — change directories
mkdir / rmdir — create or remove (empty) directory
ls — list directory contents
Changing directories with cd.Creating a directory with mkdir.Removing an empty directory.
2) File Creation & Editing
touch new_file.txt
file new_file.txt
nano new_file.txt
vi new_file.txt
touch — create or update timestamp
file — identify file type
nano — beginner-friendly editor
vi/vim — powerful modal editor
touch and file.Editing with nano.Editing with vi/vim.
3) Viewing & Searching File Content
cat new_file.txt
ls -l /home/user
tree
grep "search_term" new_file.txt
head -n 5 new_file.txt
tail -n 5 new_file.txt
cat — print file contents
ls -l — long listing (perms, owner, size, date)
tree — directory tree view
grep — pattern search
head/tail — first/last lines
cat a file.Long listing with ls -l.Directory tree.Searching with grep.head & tail.
4) Archiving & Locating Files
tar -cvf archive.tar /home/user/documents
locate filename.txt
find /home -name "filename.txt"
tar — create/extract archives
locate — indexed filename search
find — real-time search by name/size/time/etc.
Creating an archive with tar.Finding files with find.
history listing.More history.echo example.cal and date.
Conclusion
The CLI isn't magic — it's a shell interpreting your input and running small programs. Mastering these commands builds a strong foundation for administration, scripting, and troubleshooting. Explore man <command> for deeper options.