Summary

This document is a set of notes on the Linux operating system, including its history, components, architecture, and various distributions. The notes cover fundamental concepts and are designed for educational use, likely for a university-level computer science course.

Full Transcript

What is Linux Operating System Last Updated : 15 Jul, 2024  The Linux Operating System is a type of operating system that is similar to Unix, and it is built upon the Linux Kernel. The Linux Kernel is like the brain of the operating system because it manages how the computer intera...

What is Linux Operating System Last Updated : 15 Jul, 2024  The Linux Operating System is a type of operating system that is similar to Unix, and it is built upon the Linux Kernel. The Linux Kernel is like the brain of the operating system because it manages how the computer interacts with its hardware and resources. It makes sure everything works smoothly and efficiently. But the Linux Kernel alone is not enough to make a complete operating system. To create a full and functional system, the Linux Kernel is combined with a collection of software packages and utilities, which are together called Linux distributions. These distributions make the Linux Operating System ready for users to run their applications and perform tasks on their computers securely and effectively. Linux distributions come in different flavors, each tailored to suit the specific needs and preferences of users. Table of Content  Linux History  What is Linux?  What is Linux Operating System?  What is a “distribution?”  Why use Linux?  Architecture of Linux  Which distribution is right for you?  Installing Linux  Installing software on Linux  Advantages of Linux  Disadvantages of Linux  Linux Commands Linux History Linus Torvalds designed the free and open-source Linux operating system kernel in 1991. Torvalds set out to develop a free and flexible system for personal computers, drawing ideas from the UNIX operating system and the MINIX operating system. Teamwork in development was encouraged with the initial release of the Linux kernel, which attracted developers and enthusiasts globally quickly. Various open-source software packages integrated with the Linux kernel created fully operational operating systems, occasionally referred to as Linux distributions. Over the years, Linux has become known as a key component of modern computing, powering everything from servers and personal computers to supercomputers and smartphones. Due to its flexibility, durability, and strong community support, developers, businesses, and educational institutions frequently opt for it. What is Linux? Linux is a free and open-source family of operating systems that is resilient and flexible. In 1991, an individual by the name as Linus Torvalds constructed it. The system’s source code is accessible to everyone for anyone to look at and change, making it cool that anyone can see how the system works. People from all across the world are urged to work together and keep developing Linux due to its openness. Since the beginning, Linux has grown into a dependable and safe OS that is used in an array of gadgets, including PCs, cell phones, and huge supercomputers. It is well-known for being cost- effective, which implies that employing it doesn’t cost a lot, and efficient, which indicates it can complete a lot of jobs quickly. A lot of people love Linux, and What is Linux Operating System? Developed by Linus Torvalds in 1991, the Linux operating system is a powerful and flexible open-source software platform. It acts as the basis for a variety of devices, such embedded systems, cell phones, servers, and personal computers. Linux, that’s well-known for its reliability, safety, and flexibility, allows users to customize and improve their environment to suit specific needs. With an extensive and active community supporting it, Linux is an appealing choice for people as well as companies due to its wealth of resources and constant developments. What is a “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 Why use Linux? Because it is free, open-source, and extremely flexible, Linux is widely utilized. For servers and developers, it is the ideal option because it offers strong security, stability, and performance. Generally interoperable hardware, a broad software library, and a vibrant community that offers support and regular updates are the many benefits of Linux. Due to its adaptability, users can customize the operating system according to their own needs, whether they become for personal or large enterprise use. Architecture of Linux Linux architecture has the following components: Linux Architecture 1. Kernel: Kernel is the core of the Linux based operating system. It virtualizes the common hardware resources of the computer to provide each process with its virtual resources. This makes the process seem as if it is the sole process running on the machine. The kernel is also responsible for preventing and mitigating conflicts between different processes. Different types of the kernel are:  Monolithic Kernel  Hybrid kernels  Exo kernels  Micro kernels 2. System Library: Linux uses system libraries, also known as shared libraries, to implement various functionalities of the operating system. These libraries contain pre-written code that applications can use to perform specific tasks. By using these libraries, developers can save time and effort, as they don’t need to write the same code repeatedly. System libraries act as an interface between applications and the kernel, providing a standardized and efficient way for applications to interact with the underlying system. 3. Shell: The shell is the user interface of the Linux Operating System. It allows users to interact with the system by entering commands, which the shell interprets and executes. The shell serves as a bridge between the user and the kernel, forwarding the user’s requests to the kernel for processing. It provides a convenient way for users to perform various tasks, such as running programs, managing files, and configuring the system. 4. Hardware Layer: The hardware layer encompasses all the physical components of the computer, such as RAM (Random Access Memory), HDD (Hard Disk Drive), CPU (Central Processing Unit), and input/output devices. This layer is responsible for interacting with the Linux Operating System and providing the necessary resources for the system and applications to function properly. The Linux kernel and system libraries enable communication and control over these hardware components, ensuring that they work harmoniously together. 5. System Utility: System utilities are essential tools and programs provided by the Linux Operating System to manage and configure various aspects of the system. These utilities perform tasks such as installing software, configuring network settings, monitoring system performance, managing users and permissions, and much more. System utilities simplify system administration tasks, making it easier for users to maintain their Linux systems efficiently. Which distribution is right for you? Choosing the right Linux distribution depends on your needs and experience level:  For Beginners: Because of its simple user interface and strong community support, Ubuntu is a wonderful choice for initially Linux users. On the opposite hand, Linux Mint make it straightforward for novices to transition to Linux by offering an experience comparable to Windows out of the box.  For Advanced Users: Advanced users who appreciate customization and direct control might opt for Arch Linux, it is known for its simplistic style and ability to create highly unique systems from the ground up. Another choice is Gentoo, that provides total control of the system but requires manual setup and a lengthy learning process.  For Developers: Fedora was a popular choice among developers due to its focus upon modern technology and software, making it a perfect platform for software testing and development. On the other hand, Debian is well known for its reliability and extensive package repository, which implies it may be used in both production and development environments.  For Servers: For server environments, CentOS is a powerful, community-maintained distribution that matches Red Hat Enterprise Linux (RHEL) quite somewhat. As an alternative, Ubuntu Server offers an extensive list of server applications in addition to strong community support and ease of use.  For Lightweight Systems: Lubuntu is frequently picked by users either like lightweight operating systems or have outdated equipment due to its ability to utilize system resources efficiently while maintaining functionality. Another slim option is Puppy Linux, that is made to run well on outdated hardware while maintaining the essential functions and applications. Installing Linux Selecting a Ubuntu, Fedora, or Linux Mint distribution which suits your needs is the initial step in the straightforward procedure for installing Linux. Download the ISO file first from the distribution’s official website. Next, utilize an application like Etcher for macOS and Linux or Rufus for Windows to create a bootable USB drive. Following you insert the USB drive into your computer and restart it, you may set the USB drive as the primary boot device by traversing to the BIOS or UEFI settings. Upon booting from the USB the hard drive, the Linux setup will show up. To partition the drive, choose your time zone, create user accounts, and change system settings, simply adhere to the instructions displayed on the screen. When the installation concludes, disconnect the USB drive and turn on your computer normally. For mare detailed way to install the Linux Mint Refer this link. Installing software on Linux On Linux, installing software is simple. For Debian-based systems (like Ubuntu), use package managers like apt and sudo apt install package_name; for Fedora, use dnf and sudo dnf install package_name. Software centers are another source for a graphical application installation and searching interface. For Python installation specifics, detailed guidance can be found in the provided link. Advantages of Linux  The main advantage of Linux is it is an open-source operating system. This means the source code is easily available for everyone and you are allowed to contribute, modify and distribute the code to anyone without any permissions.  In terms of security, Linux is more secure than any other operating system. It does not mean that Linux is 100 percent secure, it has some malware for it but is less vulnerable than any other operating system. So, it does not require any anti-virus software.  The software updates in Linux are easy and frequent.  Various Linux distributions are available so that you can use them according to your requirements or according to your taste.  Linux is freely available to use on the internet.  It has large community support.  It provides high stability. It rarely slows down or freezes and there is no need to reboot it after a short time.  It maintains the privacy of the user.  The performance of the Linux system is much higher than other operating systems. It allows a large number of people to work at the same time and it handles them efficiently.  It is network friendly.  The flexibility of Linux is high. There is no need to install a complete Linux suite; you are allowed to install only the required components.  Linux is compatible with a large number of file formats.  It is fast and easy to install from the web. It can also install it on any hardware even on your old computer system.  It performs all tasks properly even if it has limited space on the hard disk. Disadvantages of Linux  It is not very user-friendly. So, it may be confusing for beginners.  It has small peripheral hardware drivers as compared to windows. What is the Linux File System The Linux file system is a multifaceted structure comprised of three essential layers. At its foundation, the Logical File System serves as the interface between user applications and the file system, managing operations like opening, reading, and closing files. Above this, the Virtual File System facilitates the concurrent operation of multiple physical file systems, providing a standardized interface for compatibility. Finally, the Physical File System is responsible for the tangible management and storage of physical memory blocks on the disk, ensuring efficient data allocation and retrieval. Together, these layers form a cohesive architecture, orchestrating the organized and efficient handling of data in the Linux operating system. In this article, we will be focusing on the file system for hard disks on a Linux OS and discuss which type of file system is suitable. The architecture of a file system comprises three layers mentioned below. Linux File System Structure A file system mainly consists of 3 layers. From top to bottom: 1. Logical File System: The Logical File System acts as the interface between the user applications and the file system itself. It facilitates essential operations such as opening, reading, and closing files. Essentially, it serves as the user-friendly front-end, ensuring that applications can interact with the file system in a way that aligns with user expectations. 2. Virtual File System: The Virtual File System (VFS) is a crucial layer that enables the concurrent operation of multiple instances of physical file systems. It provides a standardized interface, allowing different file systems to coexist and operate simultaneously. This layer abstracts the underlying complexities, ensuring compatibility and cohesion between various file system implementations. 3. Physical File System: The Physical File System is responsible for the tangible management and storage of physical memory blocks on the disk. It handles the low-level details of storing and retrieving data, interacting directly with the hardware components. This layer ensures the efficient allocation and utilization of physical storage resources, contributing to the overall performance and reliability of the file system. Architecture Of a File System Characteristics of a File System  Space Management: how the data is stored on a storage device. Pertaining to the memory blocks and fragmentation practices applied in it.  Filename: a file system may have certain restrictions to file names such as the name length, the use of special characters, and case sensitive-ness.  Directory: the directories/folders may store files in a linear or hierarchical manner while maintaining an index table of all the files contained in that directory or subdirectory.  Metadata: for each file stored, the file system stores various information about that file’s existence such as its data length, its access permissions, device type, modified date-time, and other attributes. This is called metadata.  Utilities: file systems provide features for initializing, deleting, renaming, moving, copying, backup, recovery, and control access of files and folders.  Design: due to their implementations, file systems have limitations on the amount of data they can store. Linux File Systems: Note: Cluster and distributed file systems will not be included for simplicity. Types of File System in Linux 1) ext (Extended File System): Implemented in 1992, it is the first file system specifically designed for Linux. It is the first member of the ext family of file systems. 2) ext2: The second ext was developed in 1993. It is a non-journaling file system that is preferred to be used with flash drives and SSDs. It solved the problems of separate timestamp for access, inode modification and data modification. Due to not being journaled, it is slow to load at boot time. 3) Xiafs: Also developed in 1993, this file system was less powerful and functional than ext2 and is no longer in use anywhere. 4) ext3: The third ext developed in 1999 is a journaling file system. It is reliable and unlike ext2, it prevents long delays at system boot if the file system is in an inconsistent state after an unclean shutdown. Other factors that make it better and different than ext2 are online file system growth and HTree indexing for large directories. 5) JFS (Journaled File System): First created by IBM in 1990, the original JFS was taken to open source to be implemented for Linux in 1999. JFS performs well under different kinds of load but is not commonly used anymore due to the release of ext4 in 2006 which gives better performance. 6) ReiserFS: It is a journal file system developed in 2001. Despite its earlier issues, it has tail packing as a scheme to reduce internal fragmentation. It uses a B+ Tree that gives less than linear time in directory lookups and updates. It was the default file system in SUSE Linux till version 6.4, until switching to ext3 in 2006 for version 10.2. 7) XFS: XFS is a 64-bit journaling file system and was ported to Linux in 2001. It now acts as the default file system for many Linux distributions. It provides features like snapshots, online defragmentation, sparse files, variable block sizes, and excellent capacity. It also excels at parallel I/O operations. 8) SquashFS: Developed in 2002, this file system is read-only and is used only with embedded systems where low overhead is needed. 9) Reiser4: It is an incremental model to ReiserFS. It was developed in 2004. However, it is not widely adapted or supported on many Linux distributions. 10) ext4: The fourth ext developed in 2006, is a journaling file system. It has backward compatibility with ext3 and ext2 and it provides several other features, some of which are persistent pre-allocation, unlimited number of subdirectories, metadata checksumming and large file size. ext4 is the default file system for many Linux distributions and also has compatibility with Windows and Macintosh. 11) btrfs (Better/Butter/B-tree FS): It was developed in 2007. It provides many features such as snapshotting, drive pooling, data scrubbing, self-healing and online defragmentation. It is the default file system for Fedora Workstation. 12) bcachefs: This is a copy-on-write file system that was first announced in 2015 with the goal of performing better than btrfs and ext4. Its features include full filesystem encryption, native compression, snapshots, and 64-bit check summing. 13) Others: Linux also has support for file systems of operating systems such as NTFS and exFAT, but these do not support standard Unix permission settings. They are mostly used for interoperability with other operating systems. Basic Linux Terminal Commands Linux Commands Functions Displays information about files in the current 1. Is command in Linux directory. 2. pwd command in Linux Displays the current working directory. Basic Linux Terminal Commands 3. mkdir command in Creates a directory. Linux 4. cd command in Linux To navigate between different folders. 5. rmdir command in Removes empty directories from the directory lists. Linux 6. cp command in Linux Copy files from one directory to another. 7. mv command in Linux Rename and Replace the files 8. rm command in Linux Delete files 9. uname command in Command to get basic information about the OS Linux 10. locate command in Find a file in the database. Linux 11. touch command in Create empty files Linux 12. ln command in Linux Create shortcuts to other files 13. cat command in Linux Display file contents on terminal 14. clear command in Clear terminal Linux 15. ps command in Linux Display the processes in terminal Basic Linux Terminal Commands 16. man command in Access manual for all Linux commands Linux 17. grep command in Search for a specific string in an output Linux 18. echo command in Print string or text to the terminal Linux 19. wget command in download files from the internet. Linux 20. whoami command in Displays the current users name Linux 21. sort command in sort the file content Linux 22. cal command in Linux View Calendar in terminal 23. whereis command in View the exact location of any command typed Linux after this command 24. df command in Linux Check the details of the file system Check the lines, word count, and characters in a 25. wc command in Linux file using different options

Use Quizgecko on...
Browser
Browser