0% found this document useful (0 votes)
70 views27 pages

Essential Linux Administration Guide

Uploaded by

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

Essential Linux Administration Guide

Uploaded by

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

Linux Administration

Presented by
Vemareddy Harika
Agenda

• Introduction
• Overview of Linux
• Key Features
• Linux file system
• Basic commands
• File and Directory management
• User Permissions
• Monitoring
• Expected Outcomes
Introduction & Objectives

• What is Linux?
• Why is it important in IT infrastructure?
• Roles of a Linux Administrator
Linux Overview, History & Distributions

• Linux = Kernel + GNU OS (together form a complete operating system).


• Origin from UNIX (1969) — created by Ken Thompson and Dennis Ritchie at AT&T Bell Labs.
• Richard Stallman’s GNU Project (1980s): Started the Free Software Movement to promote open-
source development.
• 1991: Linus Torvalds developed the Linux Kernel, shared it online, and combined it with GNU →
GNU/Linux.
• Linux became the developer’s favorite OS, widely used in servers, DevOps, and cloud systems.
Popular Linux Distributions
• Ubuntu – Beginner-friendly, great for desktops and servers
• Debian – Very stable, used for servers
• Fedora – Cutting-edge features, popular with developers
• CentOS / Rocky Linux – Enterprise servers
• Red Hat Enterprise Linux (RHEL) – Paid, used in big companies
• Arch Linux – For advanced users who want full control
Key Features

•Simplified Updates For All Installed S/W


•Free Software Licensing
•Access To Source Code
•Multiple Distributions
•Better Malware Protection
Linux File System

• Everything starts from the root /


• Folders like /home, /bin, /etc, /var, /usr
• Comparison with Windows drives (C:, D:)
• Hierarchical structure (Tree-based)
Linux-Commands

 pwd, clear, ls & cd commands


 cat, grep, sort, pipe commands
 cp, mv, mkdir, rm, rmdir & user permissions
 Processes, adding users
Basic Commands

Command Description

pwd Print current working directory

ls -l List files in long format

cd Change directory

echo Print text or variable value

su / sudo Switch or execute as superuser


Listing Directories – ls Command

Command Description

Lists all files and folders in the current


ls
directory
ls [path] Lists contents of a specific path

Long format (shows owner, permissions,


ls -l
size, time)
ls -a Shows all hidden files
ls --author Displays file author
ls -S Sorts by file size
Working Directory and Navigation – pwd and cd

Command Description

pwd Displays current working directory

cd [directory] Moves into the specified directory


cd Moves to the home directory
cd / Goes to root directory
cd .. Moves up to parent directory
cd - Returns to previous directory

cd "folder name" Use quotes if folder name contains spaces


User Switching and Permissions – su and sudo

Command Description

su Switches to root user

su [username] Switches to another specific user

Executes a command with root privileges


sudo [command]
temporarily
Clear Screen and Display Text – clear and echo

Command Description
Clears terminal output (scrolls
clear
it up)
echo [text] Prints text or variable value
echo $USER Displays current username
Searching Text – grep Command

Command Description
grep "word" [Link] Searches for word in file
grep -i "word" [Link] Case insensitive search
grep -n "word" [Link] Displays line numbers
grep -v "word" [Link] Excludes matching lines
Counts number of matching
grep -c "word" [Link]
lines
Sorting Results – sort Command

Command Description

sort [Link] Sorts alphabetically

sort -r [Link] Sorts in reverse order

sort -f [Link] Ignores case while sorting

sort -n [Link] Sorts numerically

sort [Link] [Link] Sorts combined files


Combining Commands – Pipe |

Command Description Usage Example


Sends output of one
grep "dh" [Link] |
[cmd1] | [cmd2] command as input to sort
another
[cmd1] | [cmd2] | Combines multiple grep "dh" [Link] |
[cmd3] commands sort -r | less
File Management Commands

• cat Display file contents


• cp Copy files/directories
• mv Move or rename
• rm Delete files
• mkdir / rmdir Create or remove directories
Working with Files – cat Command

Command Description
cat [file] Displays contents of a file
cat [file1 file2] Displays and joins multiple files
cat -n Adds line numbers to all lines
Adds line numbers only to non-
cat -b
blank lines
cat -s Suppresses multiple blank lines
cat -E Shows $ at end of each line
cat > [Link] Creates new file and adds text
cat >> [Link] Appends text to existing file
Working with Files – cp Command

Command Description
cp Used to copy files and directories
cp -i Interactive mode; asks before overwriting files
cp -n Does not overwrite the file
cp -u Updates destination only if source file is different

Recursive copy for directories; copies even hidden


cp -R
files

cp -v Verbose mode; prints informative messages


Working with Files – mv Command

Command Description

mv Used to move files and directories

mv -i Interactive mode; asks before overwriting files

mv -u Updates destination only if source file is different

mv -v Verbose mode; shows source and destination files


Working with Files & Directories-mkdir Command

Command Description
mkdir Used to create a new directory
Creates both a new parent directory and a
mkdir -p
sub-directory
mkdir --parents Same as -p option
Creates multiple subdirectories inside the
mkdir -p file1/{f2,f3,f4}
new parent directory
Working with Files & Directories-rmdir Command

Command Description
rmdir Removes the specified empty directory
rmdir -p Removes both the parent and child directory

Removes all parent and subdirectories along with verbose


rmdir -pv
output

rm -r Removes directories even if they are not empty


Removes non-empty directories including parent and
rm -rp
subdirectories
File Management Commands

• Types: Read (r), Write (w), Execute (x)


• Permission Sets: User, Group, Others
• Commands:
• chmod → Change permissions
• chown → Change ownership
• chgrp → Change group
Working with user permissions : ’r’, ‘w’ & ‘x’

Command Explanation
Gives write and execute permission to
chmod g+wx filename
group members
Gives read, write, and execute permission
chmod u=rwx,o-wx filename to owners; removes write/execute from
others
chown username filename Changes the owner of the specified file
Changes both owner and group ownership
chown username:groupname filename
of the file
Changes the group ownership of the
chgrp groupname filename
specified file
Monitoring

Task Command(s)
Check running processes ps, top, htop

Memory usage free -m

Disk usage df -h, du -sh

System uptime uptime

Log files location /var/log/


Summary

•Linux is a free, open-source OS.


•It has a secure, flexible file system.
•Common commands: ls, cd, pwd, cp, mv, rm, mkdir, cat, grep, sort.
•Manage files, directories, and users.
•Set permissions with chmod, chown, chgrp.
•Monitor system with ps, top, df, free.
Thank you

You might also like