Insights of Linux Operating System

·

4 min read

Insights of Linux Operating System

\==>> What is Linux Operating System?

Linux is an open-source operating system kernel originally created by Linus Torvalds in 1991. It is the foundation for various Unix-like operating systems. Linux is known for its stability, security, and customization, and it powers a wide range of devices from servers to smartphones. Many distributions (distros) build on the Linux kernel, providing different user interfaces and software packages while maintaining core compatibility. The GNU/Linux collaboration combines the Linux kernel with the GNU operating system tools to create a complete, free, and open-source operating system.

\==>> Linux History

Linux was created by Linus Torvalds in 1991 as a free and open-source operating system kernel. The first official release of the Linux kernel, version 0.01, was made available to the public in September 1991. Linux gained popularity in the 1990s, particularly with the development of various Linux distributions (distros) such as Debian, Red Hat, and Slackware. The adoption of Linux expanded in the early 2000s, with contributions from a global community of developers and the rise of the open-source movement. Today, Linux is a widely used operating system, powering servers, embedded systems, and devices, while its success is attributed to its open-source nature, stability, and flexibility.

\==>>Linux Distribution

Linux distribution is an operating system that is made up of a collection of software based on Linux kernel or you can say distribution contains the Linux kernel and supporting libraries and software. And you can get Linux based operating system by downloading one of the Linux distributions and these distributions are available for different types of devices like embedded devices, personal computers, etc. Around 600 + Linux Distributions are available and some of the popular Linux distributions are:

-MX Linux

-Manjaro

-Linux Mint

-elementary

-Ubuntu

-Debian

-Solus

-Fedora

-openSUSE

-Deepin

\==>>Architecture of Linux

Diagram Link--https://media.geeksforgeeks.org/wp-content/uploads/20200105215737/Untitled-Diagram-215-1.jpg

\==>> File System Hierarchy

  • (root):-

    • The root directory is the top-level directory in the Linux file system hierarchy.

    • It contains all other directories and files on the system.

    • In the command line, the root directory is represented by a forward slash (/).

  • /bin (binaries):-

    • The /bin directory contains essential binary executables (programs) that are needed for basic system operation and available to all users.

    • Common utilities and commands like date,cal,ls, cp, mv, rm, and mkdir are stored here.

  • /sbin (system binaries):-

    • The /sbin directory contains binary executables specifically used for system administration tasks.

    • These binaries are typically meant to be executed by the system administrator or root user.

    • Commands like fdisk, ifconfig are located here.

  • /usr (user):-

    • The /usr directory stores user-related files and programs.
  • /usr/bin:- User commands

  • /usr/sbin:- System administration commands

  • /usr/local:- Locally customized software.

  • /etc (etcetera):-

    • The /etc directory contains configuration files for the system and various applications.

    • Files like /etc/passwd (user information), /etc/group (group information), and /etc/hosts (network hostname resolution) are found here.

  • /home (home directories):

    • The /home directory contains home directories for regular users.

    • Each user typically has a subdirectory under /home where they can store personal files and configurations.

  • /root :- Home directories for the administrative superuser, root

  • /boot:- File needed in order to start the boot process

  • /var (variable):-

    • The /var directory holds variable data files that change during system operation.

    • It includes log files (/var/log), system mail (/var/mail), and spool directories (/var/spool) for various services.

  • /tmp (temporary):-

    • The /tmp directory is used for temporary files that are typically deleted upon system reboot.

    • Applications and users can store temporary files here.

  • dev (devices):-

    • The /dev directory contains special device files that represent physical and virtual devices connected to the system.

    • These device files allow interaction between the operating system and hardware or software components.

Diagram Link--https://imgs.search.brave.com/DkkzevO2Gankxc3tuoVaA2L0EAUkPYQ4GeFyvqH72xY/rs:fit:860:0:0/g:ce/aHR0cHM6Ly9saW51/eGhhbmRib29rLmNv/bS9jb250ZW50L2lt/YWdlcy8yMDIwLzA2/L2xpbnV4LXN5c3Rl/bS1kaXJlY3RvaWVz/LXBvc3Rlci5wbmc

Basic Listing commands

ls option_flag arguments --> list the sub directories and files avaiable in the present directory

Examples:

  • ls -l--> list the files and directories in long list format with extra information

  • ls -a --> list all including hidden files and directory

  • ls *.sh --> list all the files having .sh extension.

  • ls -i --> list the files and directories with index numbers inodes

  • ls -d */ --> list only directories.(we can also specify a pattern)

Directory commands

  • pwd --> print work directory. Gives the present working directory.

  • cd path_to_directory --> change directory to the provided path.

  • cd ~ or just cd --> change directory to the home directory.

  • cd - --> Go to the last working directory.

  • cd .. --> change directory to one step back.

  • cd ../.. --> Change directory to 2 levels back.

  • mkdir directoryName --> to make a directory in a specific location.

Examples:

mkdir newFolder              # make a new folder 'newFolder'

mkdir .NewFolder              # make a hidden directory (also . before a file to make it hidden)

mkdir A B C D                  #make multiple directories at the same time

mkdir /home/user/Mydirectory   # make a new folder in a specific location

mkdir -p  A/B/C/D              # make a nested directory
Â