π¦ UNIT β I : Linux Introduction, File System & Basic Commands
β 1. Introduction to Linux
- Linux is a free, open-source, secure and stable operating system.
-
Based on UNIX, widely used in:
- Servers
- Cloud systems
- Networking
- Cybersecurity
- Development
-
Known for:
- High security
- Fast performance
- Virus resistance
- Multiuser environment
β 2. Basic Features of Linux
- Multiuser & multitasking
- Portable & open-source
- Strong networking support
- Highly customizable
- Powerful shell & scripting
β 3. Flavors (Distributions) of Linux
Common Linux distros:
- Ubuntu
- Debian
- RedHat (RHEL)
- Fedora
- CentOS
- Kali Linux
- Linux Mint
β 4. Advantages of Linux
- Free & open source
- Highly stable
- Virus free
- Powerful command line
- Supports programming & servers
- Community support
β 5. How Linux Accesses Files
Linux uses an inode-based file system, where every file has:
- inode number
- file type
- file permissions
- owner & group
- size
- storage location
Linux treats everything as a file, including:
- devices
- directories
- processes
- sockets
β 6. Linux Standard Directories
| Directory | Purpose |
|---|---|
/ |
Root directory |
/home |
User home directories |
/root |
Root user home |
/bin |
Basic user commands |
/sbin |
System admin commands |
/etc |
Configuration files |
/dev |
Device files |
/var |
Logs & variable data |
/usr |
Installed software |
/tmp |
Temporary files |
β 7. Basic File & Directory Commands
| Command | Description |
|---|---|
pwd |
Show current directory |
cd |
Change directory |
ls |
List files |
cp |
Copy files |
mv |
Move / rename |
rm |
Remove files |
mkdir |
Create directory |
rmdir |
Delete directory |
file |
Show file type |
more, less
|
View long files |
β 8. Creating & Viewing Files using cat
cat > file.txt # create
cat file.txt # view
β 9. File Comparison Commands
-
cmp file1 file2β compare byte-by-byte -
comm file1 file2β compare line-by-line
β 10. Disk Related Commands
-
df -hβ show disk free space -
du -sh folderβ folder size -
mountβ mount disk -
umountβ unmount disk
π¦ UNIT β II : Shells, Processes, Pipes, Filters, Scheduling & VI Editor
β 1. Understanding Shells
A shell is a command interpreter.
Popular shells:
- Bash (default)
- Zsh
- Ksh
- Tcsh
β 2. Processes in Linux
A process = program in execution.
Commands:
ps # show processes
top # live monitoring
kill PID # terminate
jobs # show background jobs
β 3. Connecting Processes with Pipes
ls | wc -l
Pipes send output of one command to input of another.
β 4. Input / Output Redirection
| Operator | Meaning |
|---|---|
> |
output to file |
>> |
append output |
< |
input from file |
2> |
redirect error |
&> |
output + error |
β 5. Help Commands
man commandhelp commandinfo command
β 6. Background Processing
command &
jobs
bg %1
fg %1
β 7. Managing Multiple Processes
pspgrephtopkill
β 8. Changing Process Priority
nice -n 10 program
renice 5 PID
β 9. Scheduling Commands
Using cron
crontab -e
Using at
at 5pm
β 10. File & Utility Commands
| Command | Description |
|---|---|
touch |
create empty file |
wc |
count lines/words/chars |
cut |
extract columns |
dd |
copy/convert data |
expr |
math command |
bc |
calculator tool |
β 11. VI / VIM Editor
Modes:
- Command mode
- Insert mode
- Last-line mode
Useful commands:
i β insert
x β delete char
:w β save
:q β quit
:wq β save & quit
/text β search text
β 12. Simple Filter Commands
prheadtailcutpastesortuniqtr
β 13. Regular Expression Filters
-
grepβ search patterns -
egrepβ extended grep -
sedβ search & replace
Example:
sed 's/old/new/g' file.txt
π¦ UNIT β III : Shell Programming & System Administration Basics
β 1. Introduction to Shell Programming
A shell script is a text file containing Linux commands.
Example:
#!/bin/bash
echo "Hello Linux"
Run:
chmod +x script.sh
./script.sh
β 2. Shell Programming Concepts
Variables
name="Abhishek"
echo $name
Conditions
if [ $a -gt 10 ]; then
echo "OK"
fi
Loops
for i in 1 2 3; do echo $i; done
Functions
hello(){ echo "Hello"; }
β 3. System Administration Tasks
- User management
- Disk management
- Network setup
- Package installation
- Backup & restore
- System monitoring
β 4. Configuration & Log Files
Logs are stored in:
/var/log/
Important files:
/etc/passwd/etc/shadow/etc/fstab/etc/hosts
β 5. Linux Installation Process
- Boot from USB/DVD
- Create partitions
- Install base system
- Install bootloader
- Reboot
β 6. System Startup / Shutdown
shutdown -h now
reboot
systemctl reboot
π¦ UNIT β IV : User Management, File System, Permissions & Networking
β 1. Managing User Accounts
Add user:
useradd username
passwd username
Delete user:
userdel username
β 2. Permissions & Ownership
Permission types:
- Read (r)
- Write (w)
- Execute (x)
Change permissions:
chmod 755 file
Change owner / group:
chown user file
chgrp group file
β 3. Managing Groups
groupadd group
groupdel group
β 4. Disable User Account
usermod -L user
β 5. Creating & Mounting File System
mkfs.ext4 /dev/sdb1
mount /dev/sdb1 /mnt
β 6. Super User (su / sudo)
su
sudo command
β 7. Backup & Restore
cprsynctarscp
β 8. Installing & Removing Packages
Ubuntu/Debian:
apt install package
apt remove package
RHEL/CentOS:
yum install package
rpm -ivh file.rpm
β 9. KDE & GNOME
- KDE β customizable desktop
- GNOME β modern & simple UI
β 10. Networking Administration Basics
Includes:
- Setting up LAN
- Peer-to-peer vs client/server
- Ethernet configuration
- IP addressing
- DNS setup
Commands:
ifconfigip anetstatnetconfigpingnslookup
π¦ UNIT β V : Server Installation, Configuration & Administration
β 1. Mail Server
Used to send/receive emails.
Popular: Postfix, Sendmail, Exim
β 2. DNS Server
DNS β Converts domain β IP
Popular: BIND
Configuration files:
/etc/named.conf- Zone files
β 3. Remote Access Server
Allows remote login.
Commands:
ssh user@server
scp file user@server:/path
β 4. FTP Server
Used to transfer files.
Popular:
- vsftpd
- ProFTPD
β 5. Apache Web Server
Very popular web server.
Commands:
systemctl start apache2
systemctl enable apache2
Website directory:
/var/www/html/
β 6. VNC Server
Provides GUI remote access.
Used for:
- Remote desktop
- Virtual machines
Top comments (0)