0% found this document useful (0 votes)
33 views13 pages

Introduction to Linux Basics Guide

The document provides an introduction to Linux, detailing its core philosophy, architecture, file system hierarchy, and basic commands. It covers essential topics such as file permissions, package management, user and group management, process monitoring, networking basics, and shell scripting. Popular Linux distributions like Ubuntu, CentOS, and Kali Linux are also highlighted.

Uploaded by

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

Introduction to Linux Basics Guide

The document provides an introduction to Linux, detailing its core philosophy, architecture, file system hierarchy, and basic commands. It covers essential topics such as file permissions, package management, user and group management, process monitoring, networking basics, and shell scripting. Popular Linux distributions like Ubuntu, CentOS, and Kali Linux are also highlighted.

Uploaded by

naazkakria1001
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Page 1: Introduction to Linux

Linux is a free, open-source operating system kernel first released by Linus Torvalds in
1991. It is the foundation for various "Distributions" (Distros) that serve different purposes.

Core Philosophy

 Open Source: Anyone can view, modify, and distribute the source code.
 Multi-user & Multi-tasking: Multiple users can run multiple processes
simultaneously.
 Stability & Security: Highly resistant to crashes and malware compared to other
OSs.

Popular Distributions

Distro Focus Package Manager


Ubuntu User-friendly, General use APT
CentOS/RHEL Enterprise, Servers YUM/DNF
Kali Linux Penetration Testing APT
Arch Linux Customization, Advanced Pacman
Export to Sheets

Page 2: Linux Architecture


The Linux system is built in layers, moving from the hardware up to the user.

Key Components

1. Hardware: The physical layer (CPU, RAM, Disk).


2. Kernel: The "heart" of the OS. It manages hardware resources and communicates
between software and hardware.
3. Shell: The interface that interprets your commands (e.g., Bash, Zsh).
4. Applications/Utilities: Programs like web browsers, editors, or compilers.

Page 3: The File System Hierarchy (FHS)


Unlike Windows, Linux does not use drive letters (C:, D:). Everything starts from the Root
Directory (/).

Essential Directories

 /bin & /usr/bin: Executable terminal commands (ls, cp).


 /etc: System configuration files.
 /home: Personal folders for users.
 /root: Home directory for the Superuser (Admin).
 /var: Variable data like system logs.
 /tmp: Temporary files (cleared on reboot).

Page 4: Basic Commands & Navigation


The CLI (Command Line Interface) is where the power of Linux lies.

Navigation

 pwd: Print Working Directory (shows where you are).


 ls: List files and folders. (ls -la shows hidden files).
 cd [path]: Change directory.
 cd ..: Move up one level.

File Operations

 mkdir [name]: Create a new folder.


 touch [file]: Create an empty file.
 cp [source] [dest]: Copy files.
 mv [source] [dest]: Move or rename files.
 rm [file]: Remove a file. (rm -r for folders).

Page 5: File Permissions & Ownership


Linux is a strict permission-based system. Every file has an Owner, a Group, and Others.

Permission Types

1. Read (r) = 4
2. Write (w) = 2
3. Execute (x) = 1

Managing Permissions

 chmod: Change Mode.


o Example: chmod 755 [Link] (Owner=rwx, Group=rx, Other=rx).
 chown: Change Owner.
o Example: sudo chown user:group [Link].

Page 6: Package Management


Installing software in Linux is usually done via repositories rather than downloading .exe
files.

Debian/Ubuntu (APT)

 sudo apt update: Refresh the list of available software.


 sudo apt install [package]: Install software (e.g., git, vim).
 sudo apt upgrade: Update all installed software.

RedHat/CentOS (DNF/YUM)
 sudo dnf install [package]
 sudo dnf remove [package]

Page 7: User & Group Management


Linux handles multiple users with specific security levels.

Common Commands

 sudo: "SuperUser Do" – execute a command with root privileges.


 useradd [name]: Create a new user.
 passwd [user]: Change a user's password.
 whoami: Displays the current logged-in user.
 /etc/passwd: The file containing user account information.

Page 8: Process Management & Monitoring


Linux allows you to monitor and control every running program (process).

Tools

 top: Real-time view of running processes and CPU usage.


 htop: An interactive, colorized version of top.
 ps aux: Snapshot of all running processes.
 kill [PID]: Stop a process using its Process ID.

Memory & Disk

 free -m: Shows RAM usage in Megabytes.


 df -h: Shows disk space in "Human Readable" format.
Page 9: Networking Basics
Linux is the backbone of the internet, making networking tools essential.

Essential Commands

 ip addr: Check your IP address.


 ping [address]: Check connectivity to a server.
 ssh user@host: Securely log into a remote machine.
 scp: Securely copy files between two machines over a network.
 netstat or ss: View active network connections and ports.

Page 10: Introduction to Shell Scripting


A script is a file containing a series of commands that the shell executes.

Anatomy of a Script

1. Shebang (#!/bin/bash): Tells the system which interpreter to use.


2. Comments (#): Non-executable notes.
3. Variables: NAME="Linux User"

A Simple Script Example

Bash
#!/bin/bash
echo "Hello, what is your name?"
read USERNAME
echo "Welcome to Linux, $USERNAME!"

To run it:

1. chmod +x [Link]
2. ./[Link]

Would you like me to expand on any of these sections (e.g., more advanced Shell
Scripting or Networking) before you save it?
Page 1: Introduction to Linux
Linux is a free, open-source operating system kernel first released by Linus Torvalds in
1991. It is the foundation for various "Distributions" (Distros) that serve different purposes.

Core Philosophy

 Open Source: Anyone can view, modify, and distribute the source code.
 Multi-user & Multi-tasking: Multiple users can run multiple processes
simultaneously.
 Stability & Security: Highly resistant to crashes and malware compared to other
OSs.

Popular Distributions

Distro Focus Package Manager


Ubuntu User-friendly, General use APT
CentOS/RHEL Enterprise, Servers YUM/DNF
Kali Linux Penetration Testing APT
Arch Linux Customization, Advanced Pacman
Export to Sheets

Page 2: Linux Architecture


The Linux system is built in layers, moving from the hardware up to the user.

Key Components

5. Hardware: The physical layer (CPU, RAM, Disk).


6. Kernel: The "heart" of the OS. It manages hardware resources and communicates
between software and hardware.
7. Shell: The interface that interprets your commands (e.g., Bash, Zsh).
8. Applications/Utilities: Programs like web browsers, editors, or compilers.
Page 3: The File System Hierarchy (FHS)
Unlike Windows, Linux does not use drive letters (C:, D:). Everything starts from the Root
Directory (/).

Essential Directories

 /bin & /usr/bin: Executable terminal commands (ls, cp).


 /etc: System configuration files.
 /home: Personal folders for users.
 /root: Home directory for the Superuser (Admin).
 /var: Variable data like system logs.
 /tmp: Temporary files (cleared on reboot).

Page 4: Basic Commands & Navigation


The CLI (Command Line Interface) is where the power of Linux lies.

Navigation

 pwd: Print Working Directory (shows where you are).


 ls: List files and folders. (ls -la shows hidden files).
 cd [path]: Change directory.
 cd ..: Move up one level.

File Operations

 mkdir [name]: Create a new folder.


 touch [file]: Create an empty file.
 cp [source] [dest]: Copy files.
 mv [source] [dest]: Move or rename files.
 rm [file]: Remove a file. (rm -r for folders).

Page 5: File Permissions & Ownership


Linux is a strict permission-based system. Every file has an Owner, a Group, and Others.

Permission Types

4. Read (r) = 4
5. Write (w) = 2
6. Execute (x) = 1

Managing Permissions

 chmod: Change Mode.


o Example: chmod 755 [Link] (Owner=rwx, Group=rx, Other=rx).
 chown: Change Owner.
o Example: sudo chown user:group [Link].

Page 6: Package Management


Installing software in Linux is usually done via repositories rather than downloading .exe
files.

Debian/Ubuntu (APT)

 sudo apt update: Refresh the list of available software.


 sudo apt install [package]: Install software (e.g., git, vim).
 sudo apt upgrade: Update all installed software.

RedHat/CentOS (DNF/YUM)
 sudo dnf install [package]
 sudo dnf remove [package]

Page 7: User & Group Management


Linux handles multiple users with specific security levels.

Common Commands

 sudo: "SuperUser Do" – execute a command with root privileges.


 useradd [name]: Create a new user.
 passwd [user]: Change a user's password.
 whoami: Displays the current logged-in user.
 /etc/passwd: The file containing user account information.

Page 8: Process Management & Monitoring


Linux allows you to monitor and control every running program (process).
Tools

 top: Real-time view of running processes and CPU usage.


 htop: An interactive, colorized version of top.
 ps aux: Snapshot of all running processes.
 kill [PID]: Stop a process using its Process ID.

Memory & Disk

 free -m: Shows RAM usage in Megabytes.


 df -h: Shows disk space in "Human Readable" format.

Page 9: Networking Basics


Linux is the backbone of the internet, making networking tools essential.

Essential Commands

 ip addr: Check your IP address.


 ping [address]: Check connectivity to a server.
 ssh user@host: Securely log into a remote machine.
 scp: Securely copy files between two machines over a network.
 netstat or ss: View active network connections and ports.

Page 10: Introduction to Shell Scripting


A script is a file containing a series of commands that the shell executes.

Anatomy of a Script

4. Shebang (#!/bin/bash): Tells the system which interpreter to use.


5. Comments (#): Non-executable notes.
6. Variables: NAME="Linux User"

A Simple Script Example

Bash
#!/bin/bash
echo "Hello, what is your name?"
read USERNAME
echo "Welcome to Linux, $USERNAME!"

To run it:
3. chmod +x [Link]
4. ./[Link]

Would you like me to expand on any of these sections (e.g., more advanced Shell
Scripting or Networking) before you save it?

Page 1: Introduction to Linux


Linux is a free, open-source operating system kernel first released by Linus Torvalds in
1991. It is the foundation for various "Distributions" (Distros) that serve different purposes.

Core Philosophy

 Open Source: Anyone can view, modify, and distribute the source code.
 Multi-user & Multi-tasking: Multiple users can run multiple processes
simultaneously.
 Stability & Security: Highly resistant to crashes and malware compared to other
OSs.

Popular Distributions

Distro Focus Package Manager


Ubuntu User-friendly, General use APT
CentOS/RHEL Enterprise, Servers YUM/DNF
Kali Linux Penetration Testing APT
Arch Linux Customization, Advanced Pacman
Export to Sheets

Page 2: Linux Architecture


The Linux system is built in layers, moving from the hardware up to the user.

Key Components

9. Hardware: The physical layer (CPU, RAM, Disk).


10. Kernel: The "heart" of the OS. It manages hardware resources and communicates
between software and hardware.
11. Shell: The interface that interprets your commands (e.g., Bash, Zsh).
12. Applications/Utilities: Programs like web browsers, editors, or compilers.
Page 3: The File System Hierarchy (FHS)
Unlike Windows, Linux does not use drive letters (C:, D:). Everything starts from the Root
Directory (/).

Essential Directories

 /bin & /usr/bin: Executable terminal commands (ls, cp).


 /etc: System configuration files.
 /home: Personal folders for users.
 /root: Home directory for the Superuser (Admin).
 /var: Variable data like system logs.
 /tmp: Temporary files (cleared on reboot).

Page 4: Basic Commands & Navigation


The CLI (Command Line Interface) is where the power of Linux lies.

Navigation

 pwd: Print Working Directory (shows where you are).


 ls: List files and folders. (ls -la shows hidden files).
 cd [path]: Change directory.
 cd ..: Move up one level.

File Operations

 mkdir [name]: Create a new folder.


 touch [file]: Create an empty file.
 cp [source] [dest]: Copy files.
 mv [source] [dest]: Move or rename files.
 rm [file]: Remove a file. (rm -r for folders).

Page 5: File Permissions & Ownership


Linux is a strict permission-based system. Every file has an Owner, a Group, and Others.

Permission Types

7. Read (r) = 4
8. Write (w) = 2
9. Execute (x) = 1
Managing Permissions

 chmod: Change Mode.


o Example: chmod 755 [Link] (Owner=rwx, Group=rx, Other=rx).
 chown: Change Owner.
o Example: sudo chown user:group [Link].

Page 6: Package Management


Installing software in Linux is usually done via repositories rather than downloading .exe
files.

Debian/Ubuntu (APT)

 sudo apt update: Refresh the list of available software.


 sudo apt install [package]: Install software (e.g., git, vim).
 sudo apt upgrade: Update all installed software.

RedHat/CentOS (DNF/YUM)
 sudo dnf install [package]
 sudo dnf remove [package]

Page 7: User & Group Management


Linux handles multiple users with specific security levels.

Common Commands

 sudo: "SuperUser Do" – execute a command with root privileges.


 useradd [name]: Create a new user.
 passwd [user]: Change a user's password.
 whoami: Displays the current logged-in user.
 /etc/passwd: The file containing user account information.

Page 8: Process Management & Monitoring


Linux allows you to monitor and control every running program (process).

Tools
 top: Real-time view of running processes and CPU usage.
 htop: An interactive, colorized version of top.
 ps aux: Snapshot of all running processes.
 kill [PID]: Stop a process using its Process ID.

Memory & Disk

 free -m: Shows RAM usage in Megabytes.


 df -h: Shows disk space in "Human Readable" format.

Page 9: Networking Basics


Linux is the backbone of the internet, making networking tools essential.

Essential Commands

 ip addr: Check your IP address.


 ping [address]: Check connectivity to a server.
 ssh user@host: Securely log into a remote machine.
 scp: Securely copy files between two machines over a network.
 netstat or ss: View active network connections and ports.

Page 10: Introduction to Shell Scripting


A script is a file containing a series of commands that the shell executes.

Anatomy of a Script

7. Shebang (#!/bin/bash): Tells the system which interpreter to use.


8. Comments (#): Non-executable notes.
9. Variables: NAME="Linux User"

A Simple Script Example

Bash
#!/bin/bash
echo "Hello, what is your name?"
read USERNAME
echo "Welcome to Linux, $USERNAME!"

To run it:

5. chmod +x [Link]
6. ./[Link]
Would you like me to expand on any of these sections (e.g., more advanced Shell
Scripting or Networking) before you save it?

You might also like