0% found this document useful (0 votes)
30 views11 pages

Beginner's Linux Cheatsheet-1

Uploaded by

rvemula818
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views11 pages

Beginner's Linux Cheatsheet-1

Uploaded by

rvemula818
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

BEGINNER’S

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:

Each letter represents a different type of


permission:

r = Read (can open and see the contents of a


file or folder)
w = Write (can edit or delete the file or
add/remove files from a folder)
x = Execute (can run the file if it’s a program
or script, or "enter" a folder)

If a letter is missing (like r--), it means that


permission is not allowed.

BROADUS PALMER
Permissions Breakdown
Structure of Permissions

The permissions are grouped into three sets:


1. Owner (the person who created the file or
folder)
2. Group (other users in the same group as the
owner)
3. Others (everyone else)

Example

-rwxr-xr--

rwx (Owner): Read, write, and execute permissions


r-x (Group): Read and execute, but no write permission
r-- (Others): Only read permission

BROADUS PALMER
Numbers for Permissions

Numbers for Permissions


Each permission has a number assigned
to it:
r (read) = 4
w (write) = 2
x (execute) = 1
- (no permission) = 0

To set permissions, you add the


numbers for the permissions you want.

Examples of Permission Numbers

0 = --- (no permissions) 4 = r-- (only read)


1 = --x (only execute) 5 = r-x (read and execute: 4 + 1)
2 = -w- (only write) 6 = rw- (read and write: 4 + 2)
3 = -wx (write and 7 = rwx (read, write, and execute:
execute: 2 + 1) 4 + 2 + 1)

BROADUS PALMER
Numbers for Permissions
When you use chmod, you set permissions for
owner, group, and others in that order.

Example

chmod 755 file.txt


What it means:
7 (Owner) = rwx (full permission: 4 + 2 + 1)
5 (Group) = r-x (read and execute: 4 + 1)
5 (Others) = r-x (read and execute: 4 + 1)

Common Permission Numbers 👇🏾


777 = rwxrwxrwx (everyone has full permission)
755 = rwxr-xr-x (owner has full permission, others can only read and
execute)
700 = rwx------ (only the owner has full permission)
644 = rw-r--r-- (owner can read and write, others can only read)
600 = rw------- (only the owner can read and write, no one else can
access)
Broadus Palmer
Skyrocket your cloud
career.

FOLLOW ME TO LEARN CLOUD, LAND A JOB


AND MAKE MONEY!

You might also like