Mastering the Core Pillars of Linux Administration and Cloud Readiness
1. What is Linux?
Linux is an open-source operating system used in:
- Servers
- Cloud platforms
- DevOps tools (Docker, Kubernetes)
- Supercomputers
- Android phones
Most DevOps and Cloud tools run best on Linux.
PART 1: Working with the Shell
What is a Shell?
A Shell is a command-line interface where you type commands to interact with Linux.
Example:
$ echo Hello
Hello
Here:
echo→ commandHello→ argument
Home Directory
Every user has a home directory.
Symbol:
~
Example:
$ pwd
/home/michael
Basic Linux Commands (With Examples)
1. pwd – Print Working Directory
Shows where you are:
$ pwd
/home/michael
2. ls – List Files
$ ls
Asia Europe Africa
Useful options:
$ ls -l # long listing
$ ls -a # show hidden files
$ ls -lt # sort by time
3. mkdir – Create Directory
$ mkdir Asia
$ mkdir Europe Africa America
Create nested directories:
$ mkdir -p Asia/India/Mumbai
4. cd – Change Directory
$ cd Asia
$ cd ..
$ cd /home/michael
Absolute path:
cd /home/michael/Asia
Relative path:
cd Asia
5. mv – Move or Rename
Move folder:
$ mv Europe/Morocco Africa/
Rename:
$ mv Munbai Mumbai
6. cp – Copy Files
$ cp file1.txt file2.txt
Copy directory:
$ cp -r Europe EuropeBackup
7. rm – Remove Files
$ rm file.txt
$ rm -r foldername
Be careful — no undo.
8. touch – Create File
$ touch test.txt
9. cat – View File
$ cat file.txt
Create file using redirect:
$ cat > file.txt
Type content
Ctrl + D
10. less – View Large Files
$ less largefile.txt
Controls:
- Space → next page
- b → back
- /word → search
PART 2: Getting Help
1. man
$ man date
2. –help
$ date --help
3. whatis
$ whatis date
PART 3: Bash Features
1. Command History
$ history
Use ↑ arrow to repeat commands.
2. Alias
Create shortcut:
$ alias dt=date
$ dt
3. Environment Variables
Check:
$ echo $PATH
$ echo $SHELL
Create:
$ export OFFICE=caleston
PART 4: Linux Core Concepts
Kernel vs User Space
- Kernel Space → Core system (CPU, memory, drivers)
- User Space → Applications
System calls connect them.
Example:
When you run:
cat file.txt
It uses system calls like:
- open()
- read()
- close()
Kernel Version
$ uname -r
4.15.0-72-generic
Breakdown:
- 4 → Kernel version
- 15 → Major version
- 72 → Patch
PART 5: Working with Hardware
Check CPU
$ lscpu
Check Memory
$ free -m
Check Disk
$ lsblk
$ df -h
Example output:
/dev/sda5 46G 20G 26G 45% /
PART 6: Linux Boot Process
Linux boot sequence:
- BIOS
- Bootloader (GRUB)
- Kernel loads
- systemd starts
Check systemd target:
$ systemctl get-default
Set CLI mode:
$ systemctl set-default multi-user.target
Set GUI mode:
$ systemctl set-default graphical.target
PART 7: File Types in Linux
Check file type:
$ file test.txt
Types:
| Symbol | Type |
|---|---|
| – | Regular file |
| d | Directory |
| l | Link |
| c | Character device |
| b | Block device |
PART 8: Package Management
Ubuntu / Debian
Use APT
Install:
$ apt install nginx
Update:
$ apt update
$ apt upgrade
Remove:
$ apt remove nginx
RHEL / CentOS
Use YUM
Install:
$ yum install httpd
Update:
$ yum update
Remove:
$ yum remove httpd
PART 9: Searching
find
$ find /home -name file.txt
locate
$ locate file.txt
Update database:
$ updatedb
PART 10: grep (Search Inside Files)
Search word:
$ grep error file.txt
Ignore case:
$ grep -i error file.txt
Recursive search:
$ grep -r error /var/log
Exclude word:
$ grep -v error file.txt
PART 11: Redirection
Overwrite:
$ echo Hello > file.txt
Append:
$ echo Hello >> file.txt
Redirect error:
$ command 2> error.txt
Pipe:
$ cat file.txt | grep hello
PART 12: VI Editor Basics
Open file:
$ vi file.txt
Modes:
- Command Mode
- Insert Mode
- Last Line Mode
Insert:
- Press
i
Save:
:w
Quit:
:q
Save and Quit:
:wq
Force Quit:
:q!
PART 13: Users and Groups
View users:
$ cat /etc/passwd
Check user ID:
$ id michael
Switch user:
$ su -
Use sudo:
$ sudo apt install nginx
PART 14: Disk Usage
Check disk usage:
$ df -h
Check folder size:
$ du -sh foldername
PART 15: Compression
gzip:
$ gzip file.txt
$ gunzip file.txt.gz
bzip2:
$ bzip2 file.txt
tar:
Create archive:
$ tar -cf backup.tar folder
Extract:
$ tar -xf backup.tar
Final Summary
Linux Basics includes:
- Shell commands
- File management
- Users and permissions
- Package management
- Boot process
- Kernel basics
- Hardware monitoring
- Text editing
- Searching and redirection
Leave a Reply