Table of contents
- Let's first understand what is Operating System(O.S):
- Types of OS:
- What is Linux:
- Why learn Linux or its importance:
- Linus is a kernel-based Operating System:
- History of Linux:
- Important things to remember in Linux:
- Linux Filesystem:
- File System Structure and its Description:
- What is Root?
- Linux file types:
- File System Paths:
- Find Files and Directories:
- WildCards:
Let's first understand what is Operating System(O.S):
An OS is system software that manages computer hardware and software resources and provides common services for computer programs.
In a nutshell, An OS is software that acts as a middleman or a bridge between computer hardware and the computer user. It provides a user interface and controls the computer hardware so that software can function.
Types of OS:
Desktop OS: Windows, macOS, Linux such as Ubuntu
Server OS: Windows server, Linux distributions like CentOs, Red Hat Enterprise Linux
Mobile OS: Android, iOS, Windows Mobile
Embedded OS: used in devices like routers, smart TVs, automobiles, home appliances, etc.
Real-Time OS: used in critical systems like medical equipment, car ECUs, aerospace, defense, network firewalls, home security systems, etc.
What is Linux:
It is a free and open-source OS, and it is:
Secure
Distributed
Fast
Its open-source nature means that a community of developers and users contribute to its development.
It’s similar to Windows and macOS, but it’s different in several ways
Linux is very popular for its stability, security, and flexibility. It can be modified and distributed by anyone, which has led to many different versions, known as “distributions” and each distribution is tailored(for a particular purpose) for different users.
Why learn Linux or its importance:
Widely used in servers and cloud computing
corporate world uses Linux as their primary OS
Free software philosophy
Strong command line interface
Faster processing (because of CLI)
Enhanced security
Customization because of the open-source nature
Community support
Understanding of other OS
Career opportunities
Linus is a kernel-based Operating System:
- What is the kernel: The core of the UNIX system. Kernel is the heart of your operating system because it establishes the communication between the hardware and the software.
Below is the Architecture:
Basically, kernel has four primary responsibilities:
Device managemant
Memory management
Process management
Handling for your system calls
History of Linux:
Before Linux:
UNIX: Developed in the 1970s at AT&T Bell Labs by Ken Thompson and Dennis Ritchie - UNIX is a proprietary operating system
GNU Project: In 1983, Richard Stallman launched the GNU(GNU’s Not UNIX) project - GNU is a free and open-source software
- While many tools and utilities were developed under the GNU project, a completely free OS was missing a kernel.
Birth of Linux:
1991: A 21-year-old Finland student named Linus Torvalds started developing a free OS kernel as a hobby project.
On August 25, 1991, Linus announced his project on the Minix newsgroup.
“I’m doing a (free) operating system (just a hobby, won’t be big and professional like GNU”)
Version 0.01 was released in September 1991
Not Functional
Released to the public
Version 0.02 Later in 1991
Functional
Combined with the utilities from the GNU project
It formed a completely free operating system.
Growth and Evolution:
The early 1990s: Linux rapidly evolved through collaboration over the Internet.
- So many distributions came like Slackware and Debian.
1993: Linux 1.0 was released with 176k lines of code.
Late 1990s: Commercial interest in Linux grew.
- Like Red Hat and SUSE
2000s: Linux saw significant adoption in server markets.
In 2007, Google released the Android OS for Mobile devices.
Today:
- Linux has grown from a hobbyist’s project into a powerful force in computing, powering everything from mobile devices, personal computers, and servers to mainframes and supercomputers.
So simply put, the story of Linux isn’t about a computer system. It’s about great people from all over the world working together and making this reliable, secure, and open-source operating system.
Important things to remember in Linux:
Linux has a super-user account called root
- root is the most powerful account that can create, modify, delete accounts, and make changes to system configuration files. It even can delete the entire operating system.
Linux is a case-sensitive system
- ABC is NOT the same as abc
Avoid using spaces when creating files and directories
Linux kernel is not an OS. It is a small software within Linux OS that takes commands from users and passes them to system hardware or peripherals.
Linux is mostly CLI, not GUI
Linux is very flexible as compared to other operating systems.
Linux Filesystem:
- It is a system used by an operating system to manage files. The system controls how data is saved or retrieved.
These are the Linux file system:
Ext4: This is the most widely used file system in Linux and it is known for its high performance, reliability, and scalability.
XFS: This is a high-performance file system that is optimized for large-scale data storage and is commonly used in enterprise and high-performance computing environments.
Btrfs: This is a newer file system that is designed to be flexible, scalable, and easy to manage.
These are the Windows files system:
NTFS: This is a file system commonly used in Microsoft Windows and it is supported by most modern Linux distributions.
FAT32: This is an older file system that is commonly used in older Microsoft Windows systems and is also widely used for removable storage devices such as USB drives and has limitations such as a maximum file size of 4GB.
File System Structure and its Description:
/ (Root Directory): The top-level directory that contains the entire file system hierarchy.
/boot: Holds files essential for the system's boot process, including the kernel and bootloader configuration.
/bin: Contains fundamental binary executables (commands) accessible to all users.
/etc: Stores system-wide configuration files and directories, including application-specific configurations.
/home: Home directories for individual users.
/lib and /lib64: Libraries required for the functioning of executables in
/bin
and/sbin
./sbin: Contains system binaries used for system administration tasks, requiring superuser privileges.
/usr: Holds user-related programs, libraries, and documentation.
/var: Contains variable data such as log files, mail, and temporary files.
/tmp: A directory for temporary files accessible to all users; contents are typically cleared on system reboot.
/dev: Contains device files representing physical and virtual devices attached to the system.
/proc: A virtual file system providing information about processes and system resources.
/sys: A virtual file system exposing kernel parameters and settings.
/mnt: Traditionally used as a mount point for temporary filesystems or external devices.
/opt: Used for the installation of additional software packages not part of the default system installation.
/srv: Intended for data served by the system, such as website content or file-sharing services.
/root: Home directory for the root user (superuser).
/run: A temporary filesystem holding runtime information about the system since the last boot.
/lost+found: Used by the
fsck
utility to store recovered files and fragments during filesystem repair.
fsck
fsck
is a command-line utility used for checking and repairing file system inconsistencies, and the /lost+found
directory is used by fsck
to store recovered files and fragments during the repair process.What is Root?
There are 3 types of root in the Linux system:
Root account: root is an account or a username on a Linux machine and it is the most powerful account that has access to all commands and files.
Root as /: the very first directory in Linux is also referred to as a root directory.
Root home directory: the root user account also has a directory located in /root which is called root home directory and accessed by /home command.
Linux file types:
Above you can see the file type starts with:
d - is a directory
' - ' is a file
Below you can see more:
File System Paths:
There are two paths to navigate to a filesystem:
Absolute Path:
An absolute path always begins with a '/'. This indicates that the path starts at the root directory. An example of an absolute path is:
cd /var/log/suraj
Relative Path:
A relative path does not begin with a “/”. It identifies a location relative to your current position. An example of a relative path is:
cd /var
cd log
cd suraj
Find Files and Directories:
Two main commands are used to find files/directories
find
locate
These are the key differences between find and locate
locate, uses a prebuilt database, which should be regularly updated, while find iterates over a filesystem to locate files. Thus, locate is much faster than find, but can be inaccurate if the database (can be seen as a cache) is not updated.
to update locate database run updatedb
Here is how we can do it hands-on:
WildCards:
A wildcard is a character that can be used as a substitute for any of class of characters in a search
* represents zero or more characters
? - represents a single character
[ ] - represents a range of character
do explore other wildcards
Here is how we can do it hands-on:
The end: I'm pretty sure with you'll fall in love with LInux. So do explore linux at your own and see you in the next part.