Introduction to Linux OS and Shell commands

Linux is the backbone of the internet, runs on servers, desktops, smartphones, and even powers supercomputers. Embracing Linux means tapping into a world where you control the technology, not the other way around.
Linux is the most widely used operating system for servers, holding a majority market share of around 62.7%
what exactly is it, and why should you care? Let's peel back the layers of this powerful operating system, unravel its architecture, and equip you with shell commands that'll elevate you from a curious beginner to a command-line maestro.
Understanding Linux's architecture is like decoding the blueprint of a technological marvel. Here's a breakdown:

1. The Kernel: The Core Engine
The kernel is the heart and soul of Linux. It's the bridge between your hardware and software.
Function: Manages system resources, including memory, processing, and devices.
Role: Ensures that applications and hardware communicate seamlessly.
2. System Libraries: The Essential Tools
These are special programs that help application programs interact with the kernel. They include essential libraries like GNU C Library (glibc) that offer basic functions such as file handling and memory management.
Function: Provide a standard way for applications to access system resources.
Example Libraries: GNU C Library (glibc).
3. System Utilities: The Control Panel
Utilities are programs that perform individual, specialized management tasks.
Function: Handle system operations like file manipulation, process management, and system configuration.
Examples:
cp,mv,top.
4. Shell: The Command Interpreter
The shell is a command-line interface (CLI) that allows users to communicate with the kernel.
Function: Takes your input (commands) and tells the system what to do.
Popular Shells: Bash, Zsh, Fish.
5. Applications: The User-Level Software
These are programs that you interact with directly.
- Examples: Web browsers, text editors, media players.
Basic to Advanced Shell Commands
Basic Commands
These commands help you navigate and manage files in a Linux system.
pwd - Print the current working directory:
pwdls - List files and directories:
ls -lcd - Change directories:
cd /home/user/Documentsmkdir - Create a new directory:
mkdir my_folderrm - Remove files or directories (Be cautious, as deletion is irreversible):
rm file.txt rm -r folder_nameWarning: Running
rm -rf /can delete all files on your system without prompting. Always double-check before usingrm -rorrm -rf.
Intermediate Commands
cp - Copy files and directories:
cp file1.txt file2.txtmv - Move or rename files:
mv oldname.txt newname.txtcat - View the contents of a file:
cat file.txtgrep - Search for text in a file:
grep "search_term" file.txtchmod - Change file permissions:
chmod 755 script.sh
Advanced Commands
find - Search for files:
find /home/user -name "*.txt"tar - Archive files:
tar -cvf archive.tar file.txt folder/wget - Download files from the internet:
wget http://example.com/file.ziptop - Monitor system processes:
topawk - Process and extract data from files:
awk '{print $1}' file.txt
Package Management: Installing Software
Depending on your distribution, package managers help you install, update, and remove software.
Debian/Ubuntu (
aptorapt-get):bash
$ sudo apt update $ sudo apt install package-nameRed Hat/Fedora (
dnforyum):bash
$ sudo dnf install package-nameDocumentation: The
mancommand is your friend.bash
$ man command
Conclusion
Linux is a versatile and powerful operating system with a well-structured architecture. By mastering shell commands from basic to advanced levels, users can efficiently navigate, manage files, and perform system administration tasks.
