1 Introduction to Linux

Linux is an open-source operating system kernel. Unlike Windows/macOS, it's free, customizable, and powers 90% of the internet servers. It places control in your hands.

Since the kernel is free, anyone can bundle it with software. These bundles are "Distros".
- Ubuntu/Mint: User-friendly, great for beginners.
- Kali: For hackers (pre-installed tools).
- Arch: For experts who want to build their OS from scratch.

VM (Virtual Machine): Safest. Run Linux as an app inside Windows using VirtualBox.
Dual Boot: Install alongside Windows. Choose which OS to load at startup. Better performance but risks messing up partitions.

2 Filesystem & Shell Basics

It's a tree starting at Root /.
/home: User files.
/bin: Binaries (programs like ls, cp).
/etc: Configuration files.
/var: Variable files (logs, web files).

~ (tilde) represents your home folder (e.g., /home/samarth).
/root is the home folder for the Superuser (admin).

man [command]: Show manual/help.
clear: Clear screen.
history: Show previous commands.

3 Navigation & File Manipulation

pwd: Print Working Directory (Where am I?).
ls -la: List all files (including hidden) with details.
cd ..: Go up one folder.

cp file1 file2: Copy.
mv file1 newname: Move (or Rename).
rm file: Delete (Remove). Warning: No Recycle Bin!

mkdir folder_name: Make Directory.
rmdir folder_name: Remove empty directory. Use rm -r for non-empty ones.

cat file: Show entire file content.
less file: Scroll through large files.
head/tail: Show first/last 10 lines (useful for logs).

4 Users & Permissions

Each file belongs to a User and a Group.
whoami: Shows current user.
id: Shows user/group IDs.

chmod +x script.sh: Make executable.
chmod 700 file: Only owner can read/write/execute.
chown user:group file: Change ownership.

Root: The God mode user. Can delete entire OS.
Sudo: "SuperUser DO". Allows a normal user to run one command as root (e.g., sudo apt update).

5 Package Management

How you install software.
Debian/Ubuntu: Uses apt.
RHEL/CentOS: Uses yum or dnf.
It's like an App Store for the command line.

sudo apt install python3
sudo apt remove python3

Update the list of available packages, then upgrade the installed ones.

sudo apt update && sudo apt upgrade

6 Bash Scripting

A file containing a series of commands. Must start with shebang #!/bin/bash and be executable.

#!/bin/bash
NAME="Sam"
echo "Hello $NAME"
if [ -f "file.txt" ]; then
    echo "File exists"
fi

7 Networking Basics

Commands to view network interfaces and IP addresses. ip addr show is the modern replacement for ifconfig.

ping google.com: Check connectivity.
ss -tuln: Check open ports (listening sockets).

Secure Shell: Log into remote servers securely.
ssh user@192.168.1.50

🛠 Practice Projects

Write a bash script that uses tar to compress a project folder into a .tar.gz archive, adds a timestamp to the filename (e.g., backup_2024-01-01.tar.gz), and moves it to a /backup directory.

Create a script (and schedule it with cron) that runs apt update and logs the output to a text file each week, so you know when updates are available.

Write a script that takes a username as an argument, creates the user, creates a home directory, and adds them to a specific group, automating the onboarding process.

Say Hi! 👋

Have a question or just want to connect? Drop me a message!

📧 Sending to: samarth@skilledca.in
🎉

Message Sent!

Thanks for reaching out! I'll get back to you soon.