Beginner's Linux Cheatsheet-1
Beginner's Linux Cheatsheet-1
LINUX CHEATSHEET
TO LAND YOUR NEXT ROLE!
BROADUS PALMER
Basic Navigation Commands
pwd
(Print Working Directory)
What it does: Shows you the folder you're
currently in.
ls
(list)
What it does:
Lists the files and folders in the current location.
Options:
ls -a: Shows hidden files (those that start with
.).
ls -l: Shows detailed information like
permissions, size, and date.
BROADUS PALMER
Basic Navigation Commands
cd
(Change Directories)
What it does:
Moves you to a different folder.
Examples:
cd Documents: Go to the "Documents"
folder.
cd .. : Move up one folder level.
BROADUS PALMER
File and Folder Management
mkdir
(Make Directory)
What it does:
Creates a new folder.
Example: mkdir my_folder
touch
(Touch)
What it does:
Makes a new, empty file.
Example: touch myfile.txt
cp
(Copy)
What it does:
Copies a file or folder to another location.
Examples:
cp file.txt copy_file.txt: Copies file.txt to copy_file.txt.
cp -r folder1/ folder2/: Copies everything inside folder1 to
folder2.
File and Folder Management
mv
(Move/Rename)
What it does:
Moves or renames files and folders.
Examples:
mv file.txt /home/user/: Moves file.txt to the
/home/user folder.
mv old_name.txt new_name.txt: Renames
old_name.txt to new_name.txt.
rm
(Remove)
What it does:
Deletes files or folders.
Examples:
rm file.txt: Deletes file.txt.
rm -r folder/: Deletes the folder and everything
inside it.
⚠️ Warning: Deleted files are gone for good when using
this command. No "trash" to restore from.
Viewing Content and Permissions
cat
(Concatenate and Display)
What it does:
Shows the contents of a file.
Example: cat file.txt
chmod
(Change Mode)
What it does:
Changes the permissions of a file or folder.
Example: chmod 755 file.txt
7 = full permissions (read, write, execute)
5 = read and execute only
BROADUS PALMER
Permissions Breakdown
In Linux, permissions are shown as rwx (letters) or as
numbers. Here’s a simple breakdown:
BROADUS PALMER
Permissions Breakdown
Structure of Permissions
Example
-rwxr-xr--
BROADUS PALMER
Numbers for Permissions
BROADUS PALMER
Numbers for Permissions
When you use chmod, you set permissions for
owner, group, and others in that order.
Example