Quick Reference: Linux Cheat Sheet


Welcome back to Linux Commands: Part 2! In Part 1, we covered the basics of Linux & Types of Linux commands.
In this continuation, we'll explore more intermediate and essential Linux commands that build on the basics covered earlier. This segment will guide you through commands for deeper file management that are crucial for everyday Linux use.
Here are essential Linux File management commands you should know:
File Commands:
touch f1 : Creates an empty file named f1 if it doesn’t already exist.
touch f1 f2 f3 : Creates three empty files named f1, f2, f3 if they don't already exist.
touch app.java : Creates an empty file named app.java.
touch f1{1..4} : Creates multiple files using brace expansion in Bash.
touch aws/linux : Creates a file named “linux” inside a directory named “aws”.
touch .filename : Creates dot file.
Remove/Delete files :
rm filename : Deletes (removes) the file named filename from the filesystem.
rm f1 f2 f3 : Deletes (removes) the file named f1, f2, f3 from the filesystem.
rm -f f1 : Forcefully deletes file named f1, without prompting & showing error if file doesn't exist.
rm -f f1{1..4} : Force-deletes multiple files.
rm -f * : Forcefully deletes all files in the current directory, without any confirmation.
rm -f c* : Forcefully deletes all files in the current directory whose names start with the letter “c”.
rm -f *.txt : Forcefully deletes all “.txt” files in the current directory without asking for confirmation.
Directory Commands:
mkdir folder : Creates a new directory named folder in the current working directory.
mkdir f1/f2 : Creates a folder name with f2 inside f1.
mkdir -p linux/devops/aws : Creates folder inside a folder automatically.
mkdir f1 f2 : Creates two directories named f1 and f2 in the current directory.
mkdir folder1{1..5} : Creates five directories.
pwd : Displays full path of the current directory you're in(print working directory).
Remove/Delete Empty Directories :
rmdir folder : Removes (deletes) an empty directory named folder.
rmdir * : Delete all directories.
rmdir c* : Delete all directories whose name start with the letter “c”.
rmdir folder{1..5} : Delete multiple files.
Remove/Delete Non-Empty Directories :
rm -rf fname : Forcefully & recursively deletes directory named folder along with all its contents.
rm -rf * : Forcefully and recursively delete all files and folders.
rm -rf folder/* : Forcefully & recursively deletes all contents inside “folder”, but not folder.
Change Directory commands :
cd : It takes you to your home directory directly which ever folder you are in.
cd fname (or) cd fname/ : cd(change directory) command is used to navigate into a folder.
cd - : Switches you back to your previous working directory.
cd .. : Switches you one folder back.
cd ../../ : Switches you two folders back.
cd ../../../ : Switches you three folders back.
List Commands:
ll (or) ll -l (or) ls -l : Lists files and directories in the long listing format(gives full info).
ll folder1 (or) ll folder/ : Lists all the files & folders which are present in folder1.
ls -lh : Lists files and directories in the current directory.
ls : Lists the files & directories in current working directory(will give only file/directories names).
ll -t (or) ll -lt (or) ls -t : Sorts files by modification time with most recently modified files shown first.
ll -r (or) ls -r : List files in reverse order.
ll - lrt (or) ll -ltr (or) **ll -rtl (**or) ll -trl (or) ll -lart : Used to list all files/folders.
ll -a : Shows all files including hidden files(dot files).
Copy & Move Commands:
Syntax for copy : cp source destination
cp f1 f2 : Data in f1 copies into f2.
Syntax for move : mv source destination
mv f1 f2 : f1 file moves into f2.
CAT Commands:
cat XYZ : Reads and prints the contents of the file named XYZ.
cat>XYZ : Used to overwrite data.
Contrl + D - To save data which is overwritten.
cat>>XYZ : Used to append the data(adds new text to the end).
cat file1>>file2 : Used to append the contents of file1 to file2 without deleting anything in file2.
NOTE : cat is used for viewing, creating, and appending data, but not for editing existing data within a file. To modify data, use other tools designed for editing. Ex: Command-Line Text Editors like vi/vim, nano.
CONCLUSION
That wraps up Part 2 of our journey through essential Linux commands! In this segment, we took a step beyond the basics and explored more commands that help you manage files, change directories and interact with the system at a deeper level. Whether you're navigating directories with precision, controlling user access, or keeping tabs on system performance, these commands are key to becoming more confident and efficient in the Linux environment.
As you practice and apply what you’ve learned, remember: each command is a step toward mastering the art of simplicity and precision. Don’t worry about memorizing everything at once—exploration and repetition will make these tools second nature.
Stay tuned for Part 3 to level up your Linux journey even further— Thanks for reading...
Happy learning!
Subscribe to my newsletter
Read articles from Chandana Reddy directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by

Chandana Reddy
Chandana Reddy
Hi, I'm Chandana—a curious soul navigating the world through study, reflection, and shared wisdom. My journey is rooted in self-education: exploring new ideas, skills, and perspectives that empower personal growth. I believe that learning isn’t limited to classrooms—it’s an everyday practice that transforms who we are and how we connect. Through writing, conversations, and community-building, I share insights and tools that help others learn with purpose and passion. I’m not just a student of life—I’m a contributor to its knowledge ecosystem.