Linux for DevOps (Beginners)
1. Linux Fundamentals
1.1 What is Open Source?
Open-source software is software whose source code is freely available for anyone to view, modify, and distribute. Linux is built on open-source principles.
- Source code is publicly accessible
- Community-driven development and contributions
- Free to use, modify, and redistribute
Examples: Linux, Python, Firefox, Android
1.2 What is Linux?
Linux is a free, open-source operating system kernel created by Linus Torvalds in 1991. It powers everything from smartphones to supercomputers.
- Linux is technically a kernel, not a full OS
- Full OS = Linux Kemel + GNU tools + package manager + desktop environment
- Popular distributions (distros): Ubuntu, Fedora, Debian, CentOS, Arch Linux
- Used in servers, cloud, Android, loT, supercomputers
1.3 Linux vs UNIX
Linux =Free, open-source, kemel by Linus Torvalds (1991)
UNIX = Proprietary OS from Bell Labs (1969), not free
Similarity = Both follow POSIX standards; Linux was inspired by UNIX
1.4 Why Use Linux?
- Free and open source - no licensing costs
- Highly secure - fewer viruses, strong permission model
- Stable and reliable - servers run for years without reboots
- Lightweight- runs on old hardware
- Industry standard - most servers, cloud, and DevOps tools run on Linux
- Customizable - choose your own components and desktop
- Manages CPU, memory, and I/O devices
- Provides system calls for programs to request services
- Acts as a bridge between applications and hardware
- Linux kernel is monolithic - all kernel services run in kemel space
- Open PowerShell as Administrator
- Run: wsl -- install
- Restart your PC
| grep 'pattern' file | Search for pattern in file |
| grep -i 'pattern' file | Case-insensitive search |
| grep -r 'pattern' dir/ | Recursive search in directory |
| grep -n 'pattern' file | Show line numbers with results |
| grep -v 'pattern' file | Show lines that do NOT match |
| grep -c 'pattern' file | Count matching lines |
| grep -E 'pllp2' file | Extended regex - match p1 OR p2 |