#90 Days DevOps Challenge#Zero To Hero#Day2 💻 Challenge Accepted with #tws by Shubham Londhe 👨🏫
TABLE OF CONTENTS
✍ What Is Linux?
✍ Why Linux?
✍ Linux Architecture
✍ Linux File System
✍ Basic Linux Commands
Here is my learning from today's session #Day2
✍ What Is Linux?
just like Windows, iOS, and Mac OS, Linux is an operating system. In fact, one of the most popular platforms on the planet, Android, is powered by the Linux operating system. An operating system is software that manages all of the hardware resources associated with your desktop or laptop. To put it simply, the operating system manages the communication between your software and your hardware. Without the operating system (OS), the software wouldn’t function.
The Linux operating system comprises several different pieces:
Bootloader – The software that manages the boot process of your computer. For most users, this will simply be a splash screen that pops up and eventually goes away to boot into the operating system.
Kernel – This is the one piece of the whole that is actually called ‘Linux’. The kernel is the core of the system and manages the CPU, memory, and peripheral devices. The kernel is the lowest level of the OS.
Init system – This is a sub-system that bootstraps the user space and is charged with controlling daemons. One of the most widely used init systems is systemd, which also happens to be one of the most controversial. It is the init system that manages the boot process, once the initial booting is handed over from the bootloader (i.e., GRUB or GRand Unified Bootloader).
Daemons – These are background services (printing, sound, scheduling, etc.) that either start up during boot or after you log into the desktop.
Graphical server – This is the sub-system that displays the graphics on your monitor. It is commonly referred to as the X server or just X.
Desktop environment – This is the piece that the users actually interact with. There are many desktop environments to choose from (GNOME, Cinnamon, Mate, Pantheon, Enlightenment, KDE, Xfce, etc.). Each desktop environment includes built-in applications (such as file managers, configuration tools, web browsers, and games).
Applications – Desktop environments do not offer the full array of apps. Just like Windows and macOS, Linux offers thousands upon thousands of high-quality software titles that can be easily found and installed. Most modern Linux distributions (more on this below) include App Store-like tools that centralize and simplify application installation. For example, Ubuntu Linux has the Ubuntu Software Center (a rebrand of GNOME Software) which allows you to quickly search among the thousands of apps and install them from one centralized location.
✍ Why Linux?
If you struggle with obstacles like viruses, malware, slowdowns, crashes, costly repairs, and licensing fees:
zero cost of entry… as in free. You can install Linux on as many computers as you like without paying a cent for software or server licensing.
Open source
Linux is also distributed under an open-source license. Open source follows these key tenets:
The freedom to run the program, for any purpose.
The freedom to study how the program works, and change it to make it do what you wish.
The freedom to redistribute copies so you can help your neighbor.
The freedom to distribute copies of your modified versions to others.
These points are crucial to understanding the community that works together to create the Linux platform. Without a doubt, Linux is an operating system that is “by the people, for the people”. These tenets are also a main factor in why many people choose Linux. It’s about freedom and freedom of use and freedom of choice.
✍ Linux Architecture
The architecture of the Linux system is a layered structure that comprises several components, each with a specific function. In simple terms, it can be coined as the way different parts of the Linux operating system work together to make a computer function.
The Linux architecture diagram provides a high-level overview of the various layers and components that make up the Linux operating system.
Popular Linux distributions include:
LINUX MINT
MANJARO
DEBIAN
UBUNTU
ANTERGOS
SOLUS
FEDORA
ELEMENTARY OS
OPENSUSE
✍ Linux File System
Linux file system is the collection of data and/or files stored in a computer's hard disk or storage, your computer relies on this file system .
Each directory in Linux file system has a specific function, Some of a few key directories are listed below :
/ (root directory):
The root directory is the top-level directory in the Linux file system. All other directories and files are contained within the root directory./bin:
The /bin stands for binaries. This directory contains essential command-line tools and programs that are required for basic system administration tasks./boot:
The /boot directory contains the boot loader files and kernel images needed to start the system./dev:
The /dev directory contains device files that represent hardware devices and virtual devices such as terminals, printers, and disks./etc:
The /etc directory contains system configuration files that are used by various applications and services on the system./home:
The /home directory contains the home directories of users on the system. Each user has their own subdirectory within /home where they can store their personal files and settings./lib:
The /lib directory contains shared library files that are needed by various programs on the system./media:
The /media directory is used to mount removable media such as CDs, DVDs, and USB drives./mnt:
The /mnt directory is used to mount file systems temporarily, such as network file systems or disk images./opt:
The /opt directory is used to store additional software packages that are not part of the core system./proc:
The /proc directory is a virtual file system that provides information about running processes and system resources./run:
The /run directory contains temporary files that are created by system services and daemons./sbin:
The /sbin directory contains system binaries and administrative tools that are required for system maintenance./srv:
The /srv directory is used to store data for services provided by the system./sys:
The /sys directory is a virtual file system that provides information about the system's hardware and devices./tmp:
The /tmp directory contains temporary files that are created by applications and services running on the system./usr:
The /usr directory contains user-level programs, libraries, documentation, and shared data files./var:
The /var directory contains variable data files that change frequently, such as log files and system databases.
Conclusion :
The Linux file system and directory structure are fundamental components of the operating system, enabling users to effectively manage and organize their data while maintaining system integrity and security.
Linux uses a hierarchical file system that is organized in a tree-like structure.
The topmost directory in any Linux file system is the root directory.
There are different types of file systems available in Linux, and each type has its own advantages and disadvantages, depending on the use case.
The Linux directory structure contains various directories for system binaries, boot files, device files, configuration files, user files, libraries, and system-generated files.
✍ Basic Linux Commands
The ls command in Linux
The ls command is used to list files and directories in the current working directory. This is going to be one of the most frequently used Linux commands you must know of.
The pwd command allows you to print the current working directory on your terminal. It’s a very basic command and solves its purpose very well.
While working within the terminal, moving around within directories is pretty much a necessity. The cd command is one of the important Linux commands you must know and it will help you to navigate through directories. Just type cd followed by directory as shown below
The mkdir command allows you to create directories from within the terminal. The default syntax is mkdir followed by the directory name.
The cp and mv commands are equivalent to the copy-paste and cut-paste in Windows. But since Linux doesn’t really have a command for renaming files, we also make use of the mv command to rename files and folders.
In the above command, we created a copy of the file named Sample. Let’s see how what happens if we use the mv command in the same manner. For this demonstration, I’ll delete the Sample-Copy file.
The cat, echo, and less commands
When you want to output the contents of a file, or print anything to the terminal output, we make use of the cat or echo commands. Let’s see their basic usage. I’ve added some text to our New-File that we created earlier.
root
The less command is used when the output printed by any command is larger than the screen space and needs scrolling. The less command allows use to break down the output and scroll through it with the use of the enter or space keys.
Thank You Shubham Londhe Sir for supporting and guidance :)
Subscribe to my newsletter
Read articles from directly inside your inbox. Subscribe to the newsletter Akash Raj and don't miss out.
SUBSCRIBE Akash Raj
©2023 Akash Raj @dreamdevopsakash
Powered by Hashnode - Home for tech writers and readers