From Terminal Basics to DevOps Mastery: A Complete Linux Journey

Mastering the Core Pillars of Linux Administration and Cloud Readiness

1. What is Linux?

  • Servers
  • Cloud platforms
  • DevOps tools (Docker, Kubernetes)
  • Supercomputers
  • Android phones

PART 1: Working with the Shell

What is a Shell?

$ echo Hello
Hello
  • echo → command
  • Hello → argument

Home Directory

~
$ pwd
/home/michael

Basic Linux Commands (With Examples)

1. pwd – Print Working Directory

$ pwd
/home/michael

2. ls – List Files

$ ls
Asia  Europe  Africa
$ ls -l      # long listing
$ ls -a      # show hidden files
$ ls -lt     # sort by time

3. mkdir – Create Directory

$ mkdir Asia
$ mkdir Europe Africa America
$ mkdir -p Asia/India/Mumbai

4. cd – Change Directory

$ cd Asia
$ cd ..
$ cd /home/michael
cd /home/michael/Asia
cd Asia

5. mv – Move or Rename

$ mv Europe/Morocco Africa/
$ mv Munbai Mumbai

6. cp – Copy Files

$ cp file1.txt file2.txt
$ cp -r Europe EuropeBackup

7. rm – Remove Files

$ rm file.txt
$ rm -r foldername

8. touch – Create File

$ touch test.txt

9. cat – View File

$ cat file.txt
$ cat > file.txt
Type content
Ctrl + D

10. less – View Large Files

$ less largefile.txt
  • 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

2. Alias

$ alias dt=date
$ dt

3. Environment Variables

$ echo $PATH
$ echo $SHELL
$ export OFFICE=caleston

PART 4: Linux Core Concepts

Kernel vs User Space

  • Kernel Space → Core system (CPU, memory, drivers)
  • User Space → Applications
cat file.txt
  • open()
  • read()
  • close()

Kernel Version

$ uname -r
4.15.0-72-generic
  • 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
/dev/sda5  46G  20G  26G  45%  /

PART 6: Linux Boot Process

  1. BIOS
  2. Bootloader (GRUB)
  3. Kernel loads
  4. systemd starts
$ systemctl get-default
$ systemctl set-default multi-user.target
$ systemctl set-default graphical.target

PART 7: File Types in Linux

$ file test.txt
SymbolType
Regular file
dDirectory
lLink
cCharacter device
bBlock device

PART 8: Package Management

Ubuntu / Debian

$ apt install nginx
$ apt update
$ apt upgrade
$ apt remove nginx

RHEL / CentOS

$ yum install httpd
$ yum update
$ yum remove httpd

PART 9: Searching

find

$ find /home -name file.txt

locate

$ locate file.txt
$ updatedb

PART 10: grep (Search Inside Files)

$ grep error file.txt
$ grep -i error file.txt
$ grep -r error /var/log
$ grep -v error file.txt

PART 11: Redirection

$ echo Hello > file.txt
$ echo Hello >> file.txt
$ command 2> error.txt
$ cat file.txt | grep hello

PART 12: VI Editor Basics

$ vi file.txt
  1. Command Mode
  2. Insert Mode
  3. Last Line Mode
  • Press i
:w
:q
:wq
:q!

PART 13: Users and Groups

$ cat /etc/passwd
$ id michael
$ su -
$ sudo apt install nginx

PART 14: Disk Usage

$ df -h
$ du -sh foldername

PART 15: Compression

$ gzip file.txt
$ gunzip file.txt.gz
$ bzip2 file.txt
$ tar -cf backup.tar folder
$ tar -xf backup.tar

Final Summary

  • Shell commands
  • File management
  • Users and permissions
  • Package management
  • Boot process
  • Kernel basics
  • Hardware monitoring
  • Text editing
  • Searching and redirection

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *