DEV Community

King coder
King coder

Posted on

Linux Server Administration – Complete Notes (CIITM Dhanbad)

🟦 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
Enter fullscreen mode Exit fullscreen mode

⭐ 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
Enter fullscreen mode Exit fullscreen mode

⭐ 3. Connecting Processes with Pipes

ls | wc -l
Enter fullscreen mode Exit fullscreen mode

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 command
  • help command
  • info command

⭐ 6. Background Processing

command &
jobs
bg %1
fg %1
Enter fullscreen mode Exit fullscreen mode

⭐ 7. Managing Multiple Processes

  • ps
  • pgrep
  • htop
  • kill

⭐ 8. Changing Process Priority

nice -n 10 program
renice 5 PID
Enter fullscreen mode Exit fullscreen mode

⭐ 9. Scheduling Commands

Using cron

crontab -e
Enter fullscreen mode Exit fullscreen mode

Using at

at 5pm
Enter fullscreen mode Exit fullscreen mode

⭐ 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
Enter fullscreen mode Exit fullscreen mode

⭐ 12. Simple Filter Commands

  • pr
  • head
  • tail
  • cut
  • paste
  • sort
  • uniq
  • tr

⭐ 13. Regular Expression Filters

  • grep β†’ search patterns
  • egrep β†’ extended grep
  • sed β†’ search & replace

Example:

sed 's/old/new/g' file.txt
Enter fullscreen mode Exit fullscreen mode

🟦 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"
Enter fullscreen mode Exit fullscreen mode

Run:

chmod +x script.sh
./script.sh
Enter fullscreen mode Exit fullscreen mode

⭐ 2. Shell Programming Concepts

Variables

name="Abhishek"
echo $name
Enter fullscreen mode Exit fullscreen mode

Conditions

if [ $a -gt 10 ]; then
 echo "OK"
fi
Enter fullscreen mode Exit fullscreen mode

Loops

for i in 1 2 3; do echo $i; done
Enter fullscreen mode Exit fullscreen mode

Functions

hello(){ echo "Hello"; }
Enter fullscreen mode Exit fullscreen mode

⭐ 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/
Enter fullscreen mode Exit fullscreen mode

Important files:

  • /etc/passwd
  • /etc/shadow
  • /etc/fstab
  • /etc/hosts

⭐ 5. Linux Installation Process

  1. Boot from USB/DVD
  2. Create partitions
  3. Install base system
  4. Install bootloader
  5. Reboot

⭐ 6. System Startup / Shutdown

shutdown -h now
reboot
systemctl reboot
Enter fullscreen mode Exit fullscreen mode

🟦 UNIT – IV : User Management, File System, Permissions & Networking


⭐ 1. Managing User Accounts

Add user:

useradd username
passwd username
Enter fullscreen mode Exit fullscreen mode

Delete user:

userdel username
Enter fullscreen mode Exit fullscreen mode

⭐ 2. Permissions & Ownership

Permission types:

  • Read (r)
  • Write (w)
  • Execute (x)

Change permissions:

chmod 755 file
Enter fullscreen mode Exit fullscreen mode

Change owner / group:

chown user file
chgrp group file
Enter fullscreen mode Exit fullscreen mode

⭐ 3. Managing Groups

groupadd group
groupdel group
Enter fullscreen mode Exit fullscreen mode

⭐ 4. Disable User Account

usermod -L user
Enter fullscreen mode Exit fullscreen mode

⭐ 5. Creating & Mounting File System

mkfs.ext4 /dev/sdb1
mount /dev/sdb1 /mnt
Enter fullscreen mode Exit fullscreen mode

⭐ 6. Super User (su / sudo)

su
sudo command
Enter fullscreen mode Exit fullscreen mode

⭐ 7. Backup & Restore

  • cp
  • rsync
  • tar
  • scp

⭐ 8. Installing & Removing Packages

Ubuntu/Debian:

apt install package
apt remove package
Enter fullscreen mode Exit fullscreen mode

RHEL/CentOS:

yum install package
rpm -ivh file.rpm
Enter fullscreen mode Exit fullscreen mode

⭐ 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:

  • ifconfig
  • ip a
  • netstat
  • netconfig
  • ping
  • nslookup

🟦 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
Enter fullscreen mode Exit fullscreen mode

⭐ 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
Enter fullscreen mode Exit fullscreen mode

Website directory:

/var/www/html/
Enter fullscreen mode Exit fullscreen mode

⭐ 6. VNC Server

Provides GUI remote access.

Used for:

  • Remote desktop
  • Virtual machines

Top comments (0)