{"id":27903,"date":"2021-04-01T08:03:00","date_gmt":"2021-04-01T02:33:00","guid":{"rendered":"https:\/\/www.mygreatlearning.com\/blog\/linux-tutorial\/"},"modified":"2024-04-30T17:13:39","modified_gmt":"2024-04-30T11:43:39","slug":"linux-tutorial","status":"publish","type":"post","link":"https:\/\/www.mygreatlearning.com\/blog\/linux-tutorial\/","title":{"rendered":"Linux Tutorial | Everything you need to know about Linux"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\" id=\"introduction-to-linux\"><strong>Introduction to Linux <\/strong><\/h2>\n\n\n\n<p>Let's get started with the Linux Tutorial! It is a free, open-source, and community-developed operating system. It was created as a hobby by Linus Torvalds in 1991. Linus, while at university, wanted to create an alternative, free, open-source version of the MINIX operating system that is based on the principles and design of Unix. This OS became the most-used OS on publicly available internet servers and the only OS used on the top 500 fastest supercomputers. The source code of Linux can be modified and distributed commercially or non-commercially to anyone under the GNU General Public License.<\/p>\n\n\n\n<p>Moving ahead in this Linux Tutorial. It was mainly created for personal computers and later on used in other machines like mainframe computers, supercomputers, servers, etc. Linux is also used in embedded systems like automation controls, routers, televisions, digital video recorders, video game consoles, etc. Linux has been designed mainly for the (CLI) command-line interface, but we can also use a desktop environment for graphical experience using <em>GNOME<\/em> or <em>KDE Desktop<\/em> environment. Linux can run on all major UNIX software tools, applications, and network protocols. It supports 32-bit \/64-bit hardware. Linux also has Unix network-centric design ideas and is a multi-user network operating system. The system users have limited rights to use the system, and these rights given by the System administrator who has access to the root account.&nbsp;<\/p>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:100%\">\n<p><strong><em><a href=\"https:\/\/www.mygreatlearning.com\/academy\/learn-for-free\/courses\/linux-tutorial\">Enroll now to Free Online Linux Tutorial For Beginners<\/a><\/em><\/strong><\/p>\n<\/div>\n<\/div>\n\n\n\n<p>A <strong>Linux distro or distribution<\/strong> is a version of an open-source OS. It is packaged with various other components like installation programs, management tools, and additional software like KVM hypervisor. Red Hat Enterprise Linux from Red Hat is the most popular Linux distribution. RHEL is developed explicitly for the business market. Google's Android OS is based on Linux. <\/p>\n\n\n\n<p>Linux distro or distributions also come in all sizes and shapes. Many, if not all distributions, offer the ability to run directly via DVD\/CD in what\u2019s known as a \u2018Live CD\u2019 environment or even via USB if the motherboard supports booting from USB.<\/p>\n\n\n\n<p>The three popular Desktop distributions of Linux are:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Ubuntu<\/li>\n\n\n\n<li>Linux Mint<\/li>\n\n\n\n<li>Fedora<\/li>\n<\/ol>\n\n\n\n<p>The four popular Server versions of Linux are:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Slackware<\/li>\n\n\n\n<li>CentOS<\/li>\n\n\n\n<li>Debian<\/li>\n\n\n\n<li>OpenSUSE<\/li>\n<\/ol>\n\n\n\n<p>The two most popular Virtual Server versions of Linux are:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Citrix XenServer<\/li>\n\n\n\n<li>VMWare<\/li>\n\n\n\n<li><\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"linux-architecture\"><strong>Linux Architecture<\/strong><\/h3>\n\n\n\n<p>The Linux OS has primarily three components:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Kernel<\/strong>: On the core is the Linux kernel that mediates access to the underlying hardware resources such as the CPU via the scheduler, memory, and peripherals.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Shell<\/strong>: Shell (Ex: Bash, cShell, etc.) provides user access to the kernel, command interpretation and the means to load user applications and execute them.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Applications<\/strong>: Applications make up the bulk of the GNU\/Linux operating system. These applications provide useful functions for the OS, such as web browsers, windowing systems, language interpreters, email programs, and programming and development tools.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"kernel-components\"><strong>Kernel Components<\/strong><\/h3>\n\n\n\n<p>It mediates access to the system resources, i.e., interfaces, the CPU, etc. It also enforces the security of the system and protects users from one another. The kernel is made up of the below major&nbsp; components:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>init<\/strong><\/li>\n<\/ul>\n\n\n\n<p>The <em>init<\/em> is performed upon booting the Linux kernel. This provides the entry point for the kernel. The <em>Init<\/em> architecture-dependent because different processor architectures have other <em>init<\/em> requirements. The <em>init<\/em> is also parsed and acts upon any options that are passed to the kernel. The sequence of events that <em>init<\/em> performs:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>&nbsp;Kernel Hardware initialization<\/li>\n\n\n\n<li>Opens the initial console&nbsp; and starts up the&nbsp;<em>init<\/em>&nbsp;process<\/li>\n\n\n\n<li>This process is the parent of all within GNU\/Linux<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"process-scheduler\"><strong>Process Scheduler<\/strong><\/h3>\n\n\n\n<p>The Process Scheduler is to manage the processes running in a system. The schedule is a pre-emptive one. This means that the scheduler permits a process to execute for some duration. If the process is not finished, then the scheduler temporarily halts the process and will start executing another one. The scheduler can be controlled by the scheduling policy (i.e. FIFO or Round-Robin scheduling).<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"memory-manager\"><strong>Memory Manager<\/strong><\/h3>\n\n\n\n<p>This is one of the important core parts of the kernel, and it provides physical to virtual memory mapping functions and vice-versa. It also provides paging and swapping to a physical disk. It works with architecture-dependent code to access the machine\u2019s physical memory.&nbsp; The kernel maintains its own virtual address space, so each process in the user space has its own virtual address space that is individual and unique.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"virtual-file-system\"><strong>Virtual File System<\/strong><\/h3>\n\n\n\n<p>The Virtual File System is an abstract layer within the Linux kernel that presents a common view of differing file systems to upper-layer software. The Virtual File System interfaces to the device drivers to mediate how the data is written to the media.<\/p>\n\n\n\n<p>Linux OS supports a large number of file systems (ie.. ext2, Minix, NFS). Rather than presenting each of these as a unique file system, Linux provides a layer into which file systems can plug their common functions, i.e. open, close, read, write, select, and so on. Therefore, if we needed to open a file on an ext2 journaling file system, we could openly use the same common function as we would on any other file systems.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"network-interface\"><strong>Network Interface<\/strong>&nbsp;<\/h3>\n\n\n\n<p>It offers a similar architecture to Virtual File System. The network interface component is made up of 3&nbsp; layers that work to abstract the details of networking to higher layers while presenting a common interface regardless of the underlying protocol or physical medium.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"loadable-modules\"><strong>Loadable Modules<\/strong>&nbsp;<\/h3>\n\n\n\n<p>These are an important element of&nbsp; Linux as they provide the means to change the kernel dynamically. The footprint for the kernel can be small, which requires modules dynamically loaded as needed. Outside of new drivers, the kernel module component can also be used to extend the Linux kernel with new functionality.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"device-drivers\"><strong>Device Drivers<\/strong>&nbsp;<\/h3>\n\n\n\n<p>This component provides a plethora of device drivers that are available. Half of the Linux kernel source files are dedicated to devising drivers. As it is not surprising, given a large number of hardware devices out there, it does give you a good indication of how much Linux supports.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"advantages-of-linux\"><strong>Advantages of Linux<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"1-open-source\"><strong>1. Open source<\/strong><\/h3>\n\n\n\n<p>Linux is an open-source operating system. We can easily get the source code for Linux and edit it to develop our personal operating system. Linux is widely used for both home and office uses. It is the main OS used for high-performance business and in web servers. Linux has had a strong influence on this world.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"2-low-cost\"><strong>2. Low cost<\/strong><\/h3>\n\n\n\n<p>Linux software comes with the GNU General Public License, and there is no need to spend time and huge amounts of money to obtain licenses.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"3-stability\"><strong>3. Stability<\/strong><\/h3>\n\n\n\n<p>Linux has high stability, and there is no need to reboot the Linux system to maintain performance levels as it rarely freezes or slows down.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"4-performance\"><strong>4. Performance<\/strong><\/h3>\n\n\n\n<p>Linux provides high performance over various networks, and it has the ability to handle a large number of users simultaneously.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"5-flexibility\"><strong>5. Flexibility<\/strong><\/h3>\n\n\n\n<p>It is very flexible and can be used for high-performance server applications, desktop applications, and embedded systems. We can install only the needed components for a particular use and also restrict the use of specific computers.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"6-compatibility\"><strong>6. Compatibility<\/strong><\/h3>\n\n\n\n<p>It runs most Unix software packages and also processes all common file formats.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"7-online-help\"><strong>7. Online Help<\/strong><\/h3>\n\n\n\n<p>Linux help is always available on the Internet as there is probably someone out there who is in a Linux newsgroup or a mailing list who is ready to help you to solve your problem. As the source code is available, we can paste the code itself! Linux culture is one that thrives for people helping people.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"8-older-computers\"><strong>8. Older Computers<\/strong><\/h3>\n\n\n\n<p>If we install an older computer (Pentium III or later) lying around, we can install Linux and essentially have a new computer. In most cases, Linux runs faster, and we perform all the basics, i.e. email, play games, edit documents and web browsing, create and edit spreadsheets and PowerPoint presentations. Of course, Linux works best on new computers.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"9-debug-time\"><strong>9. Debug Time<\/strong><\/h3>\n\n\n\n<p>Linux applications are being developed and tested by many people. As many developers are working on it, there is a chance of quicker solutions if any problem is found. To find a solution, the debug time is only a few hours in some cases.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"10-maintenance\"><strong>10. Maintenance<\/strong><\/h3>\n\n\n\n<p>Maintaining the Linux operating system is easy, as the user can update the OS, and all software is installed very easily. The variants of Linux OS have their central software repository, which can update the system and keep it safe. It also offers regular updates, and the system can be updated without rebooting it. The updating can be done periodically, with just a few clicks, or users will automate the updating process. Updating in any other operating system is not so easy compared to a Linux system.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"11-no-anti-virus-software-needed\"><strong>11. No anti-virus software needed<\/strong><\/h3>\n\n\n\n<p>Linux does not need antivirus software to be installed on our computer.&nbsp; Linux has a lesser chance of being affected by viruses. The main reason for strong virus protection in Linux is due to the large number of open source developers who keep an eye on virus-related activities. The source code is updated in no time when it is available online.&nbsp;<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"12-text-editors\"><strong>12. Text editors<\/strong><\/h3>\n\n\n\n<p>Linux has a wide range of text editors. Programmers can pick any free software packages like visual studio code, Vim, Atom etc. Many text editors are freely available, and we can use it without any problems.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"13-powerful-command-prompt\"><strong>13. Powerful command prompt<\/strong><\/h3>\n\n\n\n<p>Command prompt in Linux is advanced, and a developer can perform most of the work using the command-line interface. We can install various repositories and packages through the command-line interface (CLI).<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"14-no-reboot-needed\"><strong>14. No reboot needed<\/strong><\/h3>\n\n\n\n<p>In windows, we need to reboot the system when we install\/uninstall any software. The system often becomes slow while rebooting it. But this is not the case in&nbsp; Linux. We do not need to reboot our system in such cases.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"15-low-system-specifications\"><strong>15. Low system specifications<\/strong><\/h3>\n\n\n\n<p>We can still run Linux on old computers that have low specifications. Linux has different distributions that are available for large scale computers, servers, PC etc.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"16-good-at-multitasking\"><strong>16. Good at multitasking<\/strong><\/h3>\n\n\n\n<p>If we want to do batch work like printing a large file or downloading a big file, we can concurrently perform other tasks like typing\/coding any program. Linux is good at such multitasking, and the system will not slow down.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"17-less-disk-space-needed\"><strong>17. Less disk space needed<\/strong><\/h3>\n\n\n\n<p>We can still run Linux if we have limited disk space.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"18-file-formats\"><strong>18. File formats<\/strong><\/h3>\n\n\n\n<p>Linux supports a large number of file formats, and we can install different software packages for specific file formats.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"19-programmer-friendly\"><strong>19. Programmer-Friendly<\/strong><\/h3>\n\n\n\n<p>Linux is an excellent platform for developers, and at its core, Linux is also designed to be tinker with. Linux modularity, i.e. it is possible to recreate a local testing environment for programs. Programmers\/Developers can learn Linux through practical experience.&nbsp; Linux is flexible enough to support if the developers want to peek into the source code or build a program from scratch.&nbsp;<\/p>\n\n\n\n<p>Linux Software is organized in repositories, i.e., places where official and controlled versions of almost every piece of the software reside. These repositories are maintained by the Linux community and guarantees that the applications we download from them are updated and safe.<\/p>\n\n\n\n<p>And this type of organization saves a lot of time for Linux users to find\/download an application. We need to simply search for its name in the repository and verify whether it is the latest version or not or scan it for viruses. We can update all the software on our PC with a single click.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"20-linux-is-secure-and-versatile\"><strong>20. Linux is secure and versatile<\/strong><\/h3>\n\n\n\n<p>UNIX's idea of security is the basis for the security model used in Linux, which is known to be robust and of proven quality. Linux is not only fit for use as a fort against enemy attacks from the Internet, but also it will adapt equally to other situations, utilizing the same high standards for security, and our development machine or control station will be as secure as your firewall.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"linux-features\"><strong>Linux Features<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"1-portability\"><strong>1. Portability<\/strong><\/h3>\n\n\n\n<p>Linux software works in various types of hardware without any deviation. We can also install the <strong>Linux OS <\/strong>on any hardware without any fear of it being incompatible, and it works in the same way whether it is high- or low-end hardware.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"2-linux-os-is-open-source\"><strong>2. Linux OS is Open-source<\/strong><\/h3>\n\n\n\n<p>The source code of Linux is available to the public for use and modified freely as many developers work together in groups to make Linux stronger and better. Moreover, developers keep on working and upgrading the systems continually.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"3-accepts-many-users\"><strong>3. Accepts many users<\/strong><\/h3>\n\n\n\n<p>One of the<strong> best features of the Linux Operating System <\/strong>is that it allows multi-users to use the operating system, random access memory and applications at the same time without any issues.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"4-many-programs-run-simultaneously\"><strong>4. Many programs run simultaneously<\/strong><\/h3>\n\n\n\n<p>We can run many program applications on the Linux OS at the same time. This is one of the best features of the Linux Operating System.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"5-linux-operating-system-has-ordered-file-system\"><strong>5. Linux Operating System has ordered file system<\/strong><\/h3>\n\n\n\n<p>We have ordered a filing system in the Linux OS, and all the user files and system files are arranged in order.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"6-application-support\"><strong>6. Application Support<\/strong><\/h3>\n\n\n\n<p>Linux has a software repository that allows users to download and install commands in shell or Linux Terminal, and it can also run Windows applications too.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"7-multi-user\"><strong>7. Multi-user<\/strong><\/h3>\n\n\n\n<p>In Linux, multiple users can access the resources like ram, memory, and applications at the same time.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"8-adaptable\"><strong>8. Adaptable<\/strong><\/h3>\n\n\n\n<p>Linux can work on any of the hardware in a simple and efficient way. The software is portable to any of the devices and needs Linux Kernel and other applications to be installed properly to make it work.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"9-hierarchical\"><strong>9. Hierarchical<\/strong><\/h3>\n\n\n\n<p>Linux has a standard hierarchy structure, and it has system and user files that are arranged in a structured form.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"10-shell\"><strong>10. Shell<\/strong><\/h3>\n\n\n\n<p>Linux provides an interpreter program used to execute command operations of the OS, and it is also used to do various types of operations like call operation and so on. Linux Shell works like a programming language, and it provides commands and keywords.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"11-graphical-user-interface\"><strong>11. Graphical User Interface<\/strong><\/h3>\n\n\n\n<p>Linux has a lot of packages, and it can be installed to make OS graphics as windows.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"12-application-support\"><strong>12. Application Support<\/strong><\/h3>\n\n\n\n<p>Linux software repository allows users to download and install just by a command in shell or Linux Terminal. It can also run Windows applications if in case the user wants to.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"13-user-friendly\"><strong>13. User-Friendly<\/strong><\/h3>\n\n\n\n<p>Linux is a user-friendly software and it is fast, free and easy to use.&nbsp;<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"14-security\"><strong>14. Security&nbsp;<\/strong><\/h3>\n\n\n\n<p>Linux platforms' provides high-security levels when compared with others, and it provides a virus-Free environment. It uses the regular virus prevention time needed when working with other operating systems for other more important tasks. It also offers user security systems with authentication features such as encryption of data or password protection or controlled access to particular files.<\/p>\n\n\n\n<p><strong>LINUX has two levels of securities:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>System-level Security: <\/strong>Controlled\/Maintained by the system administrator.<\/li>\n\n\n\n<li><strong>File-level Security:<\/strong> Controlled\/Maintained by the owner of the file.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"15-supports-most-national-or-customized-keyboards\"><strong>15. Support\u2019s most national or customized keyboards<\/strong><\/h3>\n\n\n\n<p>Linux is used globally, and it is available in multiple languages and also supports most of the custom national keyboards.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"16-live-cd-usb\"><strong>16. Live CD\/US<\/strong>B<\/h3>\n\n\n\n<p>Linux distributions have Live CD or USB features through which users can run or try the operating system even without installing it.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"17-other-features\"><strong>17. Other Features<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Linux has improved Management code<\/li>\n\n\n\n<li>Linux has improved TCP\/Performance\n<ul class=\"wp-block-list\">\n<li>Linux has internal kernel threads for handling dependencies between loadable modules and automatic loading of modules on demand.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Linux has Standardized configuration interface<\/li>\n\n\n\n<li>Linux Support for a range of SCSI controllers for high performance disk access<\/li>\n\n\n\n<li>Linux Support for UNIX standard TCP or IP protocols<\/li>\n\n\n\n<li>Linux Device driver also support for running IP over an Ethernet<\/li>\n\n\n\n<li>Linux provides much functionality from limited resources and runs a machine having 4MB RAM.&nbsp;<\/li>\n\n\n\n<li>Linux has live patching capabilities and enables a running system to be patched without the need for a full system reboot. With Linux 5.1, a new capability is being added to live to patch, i.e. Atomic Replace.<\/li>\n\n\n\n<li>Linux has enabled regular storage devices, including hard drives, to be used for limited forms of memory usage, including swap space. With the use of Linux 5.1, administrators will now be able to more fully use storage, and particularly a class of storage now often referred to as \"persistent memory\" as regular system memory.<\/li>\n\n\n\n<li>AMD Free Sync Supporter.<\/li>\n\n\n\n<li>Implementing Official support for the Raspberry PI Touchscreen.<\/li>\n\n\n\n<li>Data Encryption.<\/li>\n\n\n\n<li>Authentication support for ARM Pointer<\/li>\n\n\n\n<li>Linux Kernel Lockdown: This model aims to enhance Linux kernel security by separating the userland and kernel code, and it also limits the root account access to kernel features that enable arbitrary code modification and execution and in this way. The Linux kernel remains safe even when the root account is compromised.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>ExFAT File System Support: exFAT file system supports large file size exFAT\u2013formatted drives for data storage and transfer. This improvement comes in the wake of Microsoft\u2019s recent (August 2019) move to open source and publish its proprietary file system.&nbsp;<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Extended audio hardware support: Linux provides extensive audio support for a No. of hardware components via its open-source sound improvement drivers. It supports several new audio hardware, including the Freescale i.MX7ULP, Cirrus Logic CS47L15\/CS47L92 etc.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"difference-between-unix-linux\"><strong>Difference between Unix &amp; Linux<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-table aligncenter\"><table><tbody><tr><td><strong>Linux<\/strong><\/td><td><strong>Unix<\/strong><\/td><\/tr><tr><td>Linux is a Free &amp; Open Source software development&nbsp; Operating System.<\/td><td>Unix is an operating system that can be utilized by its copywriters.<\/td><\/tr><tr><td>Cost: Linux can be freely distributed and downloaded. The prices for different versions for Linux are different, but they are normally cheaper than Windows.<\/td><td>Different versions of Unix have different prices.<\/td><\/tr><tr><td>Users: It can be used by everyone\u2014i.e., home users to developers and computer enthusiasts, etc.<\/td><td>Users: Unix OS was developed mainly for mainframes, servers, workstations etc. The Unix environment\/&nbsp; client-server program model were essential elements in the development of the Internet.<\/td><\/tr><tr><td>The Linux kernel is developed for sharing and collaboration of code by the community of developers. Linus Torvalds is the father of Linux.<\/td><td>Unix has three distributions: Solaris, AIX&nbsp; &amp; HP-UX. IBM, Apple also uses UNIX for OS X operating systems.&nbsp;<\/td><\/tr><tr><td>Usage: Linux can be used on a wide variety of computer hardware such as mobile phones\/tablets, computers, mainframes, supercomputers etc.<\/td><td>Usage: The UNIX OS is used in servers, workstations &amp; PCs. Support for the majority of financial infrastructure and for many 24\/365 high availability solutions.<\/td><\/tr><tr><td>&nbsp;Processors: Linux has dozens of processes of various kinds.<br><\/td><td>Processors: Unix has x86or x64, Sparc, Power and many other processors.<\/td><\/tr><tr><td>Architectures: Linux is originally created for Intel's x86 hardware, and ports available for over two dozen CPU types, including ARM.<\/td><td>Processors: It is available on PA-RISC and Itanium machines. Solaris is also available for x86\/x64 based systems.<\/td><\/tr><tr><td>Features: One of the important killer features is that the kernel is updated without reboot.<\/td><td>Features: ZFS \/ Next-generation file system, i.e., Dtrace-dynamic kernel tracing.<\/td><\/tr><tr><td>GUI: Linux provides two types of GUIs, i.e. KDE and Gnome. GUI Linux is optional.<\/td><td>Unix Initially was a command based Operating System and after that&nbsp; Graphic User Interface was created called Common Desktop Environment, and now many of the distributions come with Gnome.<\/td><\/tr><tr><td>File System Support: Ext2\/ Ext3\/ Ext4, Jfs, FAT\/ FAT3\/ NTFS formats.<\/td><td>File System Support: gpfs\/ hfs+\/ zfs etc formats.<\/td><\/tr><tr><td>Text-mode interface: BASH (Bourne Again SHell) is Linux\u2019s default shell. It can support multiple command interpreters.<\/td><td>Text-mode interface: Originally known as the Bourne Shell. Now, it is compatible with others\u2019 including BASH, Korn &amp; C.<\/td><\/tr><tr><td>Security: Linux virus has been reported between 60-100 till date approx.<\/td><td>Security: UNIX viruses have been reported between 85-120 viruses&nbsp; approx.<\/td><\/tr><tr><td>Development and Distribution: Linux is an Open Source developed through sharing and collaboration of code and features by forums etc. It is distributed by different vendors like Debian, Red Hat, SUSE, Ubuntu, GentuX etc.<\/td><td>Development and Distribution: Unix systems are categorized into different categories, mostly developed by AT&amp;T and or various commercial vendors and non-profit organizations.<\/td><\/tr><tr><td>Threat detection and solution: As far as Linux is concerned, the detection of threat and solution is very fast. Linux is especially community-driven, and when any Linux user posts any kind of threat, several developers start working on it from all corners of the world.<\/td><td>Threat detection and solution: Due to the proprietary nature of the real Unix, users need to wait for a while to reveal the proper bug fixing patch. But these aren\u2019t as common.<\/td><\/tr><tr><td>Inception: Inspired by MINIX and after adding many features of GUI\/ Drivers etc., the framework of the OS developed by Linus Torvalds became LINUX. LINUX kernel was released in 1991.<\/td><td>Inception: Developed by a team of AT&amp;T employees at Bell Labs, it was written in C language and was designed to be a transportable &amp; multi-tasking \/ multi-user system within time-sharing configuration.<\/td><\/tr><tr><td>Various Versions of Linux are Redhat\/ Ubuntu\/ OpenSuse, etc.<br><br><\/td><td>Various Versions of Unix are HP-UX\/ AIS,\/BSD, etc.<\/td><\/tr><tr><td>Source Code of Linux is available to the general public.<\/td><td>Source code isn\u2019t available to the general public.<\/td><\/tr><tr><td>Linux is considered a Unix clone, and it behaves like Unix but doesn't contain its code.<\/td><td>Unix contains different coding, which is developed by AT&amp;T Labs.<\/td><\/tr><tr><td>As Linux is open-source, whenever a user posts any issue of threat, developers from all over the world start working on it. And hence, it provides a faster solution.<br><br><\/td><td>In Unix, users got to keep waiting a while for some time for the issue to be resolved.<br><br><\/td><\/tr><tr><td>Linux is written in C \/ other programming languages.<br><br><\/td><td>Unix is mostly written in C and assembly languages.<\/td><\/tr><tr><td>Linux is Multilingual.<\/td><td>Unix is written in English only.<\/td><\/tr><tr><td>Kernel Type:&nbsp;Monolithic kernel<\/td><td>Kernel type varies. It is often monolithic, MicroKernel and Hybrid.<\/td><\/tr><tr><td>Linux\/ Unix is considered best protected against malware. This is often characterised by a lack of root access and quick updates and also a comparatively low market share. There has been no widespread Linux virus.<\/td><td>Unix is additionally considered to be very safe. It\u2019s even harder to infect because the source is code not available, and there\u2019s no actively spreading the virus for UNIX nowadays.<\/td><\/tr><tr><td>Linux has a big market share with 25 million machines installed.<\/td><td>Unix installed on 5.5 million approx.<\/td><\/tr><tr><td><strong>Limitations of Linux:<\/strong> 1. There\u2019s no standard edition of Linux. 2. Linux<strong> <\/strong>has patchier support for drivers that can cause system-wide errors. 3. Linux, at least for new users, is not as easy to use as Windows. 4. Many of the programs we use for Windows will only run on Linux using a complicated emulator. For example, Microsoft Office. 5. Linux is best suitable for a corporate user. It\u2019s much harder to introduce in a home setting.<\/td><td><strong>Limitations of Unix:<\/strong> 1. The unfriendly, terse, inconsistent, and non-mnemonic user interface. 2. Unix Operating system is designed for a slow computer system, so you can\u2019t expect fast performance. 3. The Shell interface can be treacherous because typos can destroy files. 4. Versions on different machines are slightly different, so it lacks consistency. 5. Unix does not provide a secure response time for hardware failure, so it does not support real-time response systems.&nbsp;<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"linux-vs-windows\"><strong>Linux Vs Windows<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><\/td><td><strong>Windows<\/strong><\/td><td><strong>Linux<\/strong><\/td><\/tr><tr><td>Cost<\/td><td>Microsoft Windows typically costs between $99.00 and $199.00 USD for every single licensed copy.&nbsp;Windows 10 was offered as a free upgrade for existing Windows owners. However, the deadline for that offer has long since elapsed.Windows Server 2016 data centre has a price starting at $6155.<\/td><td>Linux license remains completely free. However, organizations that need Linux support can choose paid subscriptions for platforms like RedHat and SUSE. It's better to go with these subscriptions. Otherwise, competent in-house Linux expertise can be expensive. Talking about the infrastructure cost,&nbsp; other things remaining equal (being on-premise or on the cloud), Linux being lightweight, we can expect 20% more on Linux as compared to Windows.<\/td><\/tr><tr><td>Licensing model<\/td><td>Proprietary software.<\/td><td>The Linux kernel and most of the distributions are open-source and (often) available under a GNU General Public License (GPU).<br><\/td><\/tr><tr><td>User-friendliness<\/td><td>From the outset, Windows was designed to be as simple to use as possible, even for users with no IT knowledge.<\/td><td>While it\u2019s true that Ubuntu, in particular, is relatively easy for Windows users to grasp, with most of the other Linux distributions, there are significant barriers to entry for newcomers.<\/td><\/tr><tr><td>GUI(Graphical User Interface)<\/td><td>Microsoft's standards are according to its Windows GUI.<\/td><td>Users of Linux distributions have many freedoms in designing the GUI and can even do away with it&nbsp;altogether.<\/td><\/tr><tr><td>Support<\/td><td>Windows provides a large range of support services, i.e. within the system and online and also detailed specialist literature available targeted at users with various levels of knowledge.<\/td><td>Support of Linux comes from the extensive user community, and we can find an answer to any problem in the online forums\/Wikis.<\/td><\/tr><tr><td>Software<\/td><td>Windows directs the greatest number of desktop users, and so the biggest selection of commercial software from third-party developers, many of which are not Linux compatible. It also leads in video games by a broad margin.<\/td><td>There are far fewer applications designed specifically for Linux, although some Windows programs can run on Linux.<br><\/td><\/tr><tr><td>Installing programs<\/td><td>Programs can be installed either by downloading them from websites or from a hard disk.<\/td><td>The majority of programs, drivers and packages in Linux, provided via fixed repositories.<\/td><\/tr><tr><td>Uninstalling programs<\/td><td>Components remain on the system when some programs are uninstalled.<\/td><td>Programs in Linux are always&nbsp;completely removed when some programs are uninstalled.<\/td><\/tr><tr><td>Hardware<\/td><td>Windows drivers are easily available for any type of hardware.<\/td><td>Hardware support is more limited. Some drivers are not available immediately.<\/td><\/tr><tr><td>Reliability<\/td><td>Although the stability of Windows has improved in recent years, most Linux distributions are still far superior in this respect.<\/td><td>Linux and its distributions are known for being very stable to run.<\/td><\/tr><tr><td>Security<\/td><td>Windows systems are regularly threatened by viruses and other malware.<\/td><td>Linux systems are only attacked very rarely.<\/td><\/tr><tr><td>Speed<\/td><td>Windows is known for slowing down the longer it is used.<\/td><td>Linux generally runs very quickly.<\/td><\/tr><tr><td>Updates<\/td><td>Users are sometimes forced to install updates. Most updates are stable.<\/td><td>Each user decides which updates they want to install. These are sometimes experimental and therefore not recommended for all users.<\/td><\/tr><tr><td>Trial version<\/td><td>You can download and install a trial version of Windows without paying for a license.<\/td><td>Since most of the distributions are free of charge, you can easily try them out. Many of them can even run off a USB flash drive, so you don\u2019t even need to install them.<br><\/td><\/tr><tr><td>Types of user<\/td><td>Windows is aimed at various types of user, i.e. from occasional to expert. Due to the availability of a wide range of Windows-compatible software, the OS is suitable for professional as well as for entertainment use.<\/td><td>Using Linux requires a minimum level of specialist knowledge. Computer games are only available in limited versions and Linux distributions tend to be suited to most professional IT users.<\/td><\/tr><tr><td>Access<\/td><td>Every user does not have access to the source code. Only the selected members of the group have access to the source code.<\/td><td>Users have access to the source code of the kernel and can modify it accordingly. This gives the benefit that bugs in OS will be fixed faster. However, the drawback is that the developers may take undue advantage of the loophole.<br><br><\/td><\/tr><tr><td>Privacy<\/td><td>Windows collects all the user data.<\/td><td>Linux Distros do not collect users&nbsp;data.<\/td><\/tr><tr><td><br>Customization<\/td><td><br>Windows has very limited customization options available.<br><br><\/td><td><br>Linux has a variety of distributions that are highly customizable based on the user\u2019s requirements.<br><br><br><br><\/td><\/tr><tr><td>Data Drives<\/td><td>Windows uses different data drives like C: D: E to stored files and folders.<\/td><td>Linux uses a tree-like hierarchical file system.<\/td><\/tr><tr><td>Drives<\/td><td>Windows has different drives like C: D: E.<\/td><td>There are no drives in Linux.<\/td><\/tr><tr><td>Hard Drives<\/td><td>Hard drives, CD-ROMs, printers are considered as devices.&nbsp;<\/td><td>Peripherals like hard drives,&nbsp;CD-ROMs , printers are also&nbsp;considered files in Linux.<\/td><\/tr><tr><td>User Accounts<\/td><td>There are four types of user account types 1) Administrator, 2) Standard, 3) Child, 4) Guest<br><br><\/td><td>There are three types of user account types 1) Regular, 2) Root and 3) Service Account<br><\/td><\/tr><tr><td>Admin Privileges<\/td><td>Administrator users have all administrative privileges of computers.<\/td><td>The root user is the superuser and has all administrative privileges.<br><\/td><\/tr><tr><td>Naming convention<\/td><td>In Windows, you cannot have two files with the same name in the same folder.<\/td><td>Linux file naming convention is case sensitive. Thus, sample and SAMPLE are two different files in the Linux\/Unix operating system.&nbsp;<br><br>&nbsp;<\/td><\/tr><tr><td>Home Directory<\/td><td>My document is the default home directory for windows.<\/td><td>\/home\/username&nbsp;directory is created in linux is the home directory.<\/td><\/tr><tr><td>Supported platforms<\/td><td>&nbsp;PowerPC: versions 1.0 - NT 4.0;&nbsp;DEC Alpha: versions 1.0 - NT 4.0;MIPS R4000: versions 1.0 - NT 4.0;IA-32: versions 1.0 - 10; IA-64:&nbsp;version XP; x86-64: versions XP - 10;&nbsp;ARM: version RT;<\/td><td>All<\/td><\/tr><tr><td>Updated Method<\/td><td>&nbsp;Windows Update, Microsoft Update,&nbsp; Microsoft Update Catalog<br><\/td><td>Many<\/td><\/tr><tr><td>Development &amp; Distribution<\/td><td>Developed &amp; distributed by Microsoft Corporation.<\/td><td>Linux is developed by Open Source development, i.e. through sharing and collaboration of code, and it is distributed by various vendors.<\/td><\/tr><tr><td>Preceded by<\/td><td>MS-DOS<\/td><td>Basic Terminal (CLI)<\/td><\/tr><tr><td>License<\/td><td>Proprietary<\/td><td>GNU General Public License<\/td><\/tr><tr><td>Run Level<\/td><td>In windows, if we encounter any problem in order to fix it, we need to reboot at run level three as an administrator\/root to find and fix the problem.<\/td><td>Linux has an inbuilt ability to stop at different run levels. With this, we can work using the command line and GUI if anyone has an issue.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"linux-distribution\"><strong>Linux Distribution<\/strong><\/h2>\n\n\n\n<p>A Linux distribution or a Linux Distro is an operating system made from a software collection based upon the Linux Kernel or a package management system. Linux users get their operating system by downloading one of the Linux distributions available for the various systems ranging from embedded devices and personal computers (Ex: Linux Mint) to powerful supercomputers. <\/p>\n\n\n\n<p>Linux Distribution consists of Linux Kernel, Libraries, GNU Tools, and additional software in a desktop environment. Most of the software is free and open-source. <\/p>\n\n\n\n<p>Due to&nbsp; huge availability of software, distributions have taken in a wide variety of forms i.e. for use on desktops, servers, laptops, netbooks, mobile phones etc as well as minimal environments for use in embedded systems. As there are commercially-backed distributions, like Fedora&nbsp;,&nbsp;openSUSE&nbsp; and&nbsp;Ubuntu and entirely community-driven distributions, such&nbsp; as &nbsp;Debian, &nbsp;Slackware, &nbsp;Gentoo&nbsp; and&nbsp; &nbsp;Arch Linux.&nbsp; Major&nbsp; distributions are pre-compiled and&nbsp; ready to use for a specific&nbsp;instruction set and&nbsp; some distributions (such as&nbsp;Gentoo) are distributed mostly in&nbsp;source code&nbsp;form and compiled locally during installation.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"list-of-linux-distributions\"><strong>List of Linux Distributions:<\/strong><\/h3>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"1-ubuntu\"><strong>1. Ubuntu<\/strong><\/h4>\n\n\n\n<p><strong>Ubuntu<\/strong> is an open-source operating system sponsored by <strong>Canonical company<\/strong> and a trademark registered by the same company. Ubuntu is based on Debian Linux distribution and is composed of several open-source software and is available for free for businesses.&nbsp;<\/p>\n\n\n\n<p>Ubuntu is also famous for its ease of use and its inclusion of a migration assistant for Windows users, and support for the latest technologies. Ubuntu is available in various flavours targeted at specific niches, Kubuntu, Xubuntu and Lubuntu etc.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"2-fedora\"><strong>2. Fedora<\/strong><\/h4>\n\n\n\n<p>Fedora is upstream of commercial RHEL distribution. It is special because it uses the latest technology and packages from the open-source world rather than RHEL. It also uses a Yum package manager like RHEL.&nbsp;<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"3-linux-mint\"><strong>3. Linux Mint<\/strong><\/h4>\n\n\n\n<p><strong>Linux Mint<\/strong> is based on Ubuntu or Debian is 32- and 64-bit Linux distribution for desktop computers. It started with simply being Ubuntu with pre-installed and full out-of-the-box multimedia support and proprietary software such as Adobe Flash. Newer versions of the Ubuntu-based Linux Mint have been released every six months.&nbsp;<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"4-opensuse\"><strong>4. OpenSUSE<\/strong><\/h4>\n\n\n\n<p>OpenSUSE started out a&nbsp; German translation of Slackware and is a community supported by SUSE distribution and is the successor to SUSE Linux Professional and serves as the basis for SUSE Linux Enterprise products.<\/p>\n\n\n\n<p>Newer versions are released every eight months and support many languages, and each release is provided with security updates for a period of 18 months.&nbsp;<\/p>\n\n\n\n<p>It is a completely open-source system, and it contains therefore not proprietary drivers or codecs to support most closed multimedia formats. However, it is possible to install the packages to take advantage of these materials, as well as drivers for ATI or Nvidia.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"5-pclinuxos\"><strong>5. PCLinuxOS<\/strong><\/h4>\n\n\n\n<p><strong>PCLinuxOS<\/strong> is a Linux distribution often shortened to PCLOS, with KDE, MATE etc., as its default user interfaces. It is a free software operating system for personal computers, and it is considered a rolling release. And this distribution makes it easy to install drivers, edit photos, get Office software, and start using multimedia. PCLinuxOS uses apt and synaptic to handle RPM packages. PC Linux OS is a rolling distro. It also supports Flatpak. The PCLinuxOS teams offer three different versions <strong>KDE<\/strong>, <strong>MATE<\/strong>, and <strong>XFCE<\/strong>.&nbsp;<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"6-debian\"><strong>6. Debian<\/strong><\/h4>\n\n\n\n<p><strong>Debian<\/strong> is a free OS for computers. It is the most important available distros at present. It serves as the base for Ubuntu, and many users consider it as the best one suited. With Debian, we have the possibility to use all open-source components. Debian has a slow release cycle, having a period of 1 to 3 years.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"7-sabayon-gentoo\"><strong>7.&nbsp; Sabayon\/Gentoo<\/strong><\/h4>\n\n\n\n<p><strong>Sabayon Linux<\/strong> is a Linux distribution based on Gentoo, and Sabayon installs the base system from precompiled packages.<\/p>\n\n\n\n<p>Sabayon Linux is a ready distribution that includes the basic proprietary drivers of different graphic and wireless cards, audio codecs \u2013 video, flash, java, etc. so that the system can work without being installed after installation. It is not a free tool completely.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"8-arch-linux\"><strong>8. Arch Linux<\/strong><\/h4>\n\n\n\n<p><strong>Arch Linux<\/strong> distribution was created by Judd Vinet. Arch Linux was designed for advanced users to be the perfect operating system. It adheres to 5 principles: User centrality, pragmatism, modernity, simplicity, versatility that means that project attempts to have minimal distribution-specific changes, minimum breakage with updates etc. Arch Linux uses a rolling release model meaning no major releases of new versions of the system, and regular updates are needed to obtain the latest arch software.&nbsp;<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"9-puppy-linux\"><strong>9. Puppy Linux<\/strong><\/h4>\n\n\n\n<p><strong>Puppy Linux<\/strong>&nbsp;is a Linux distribution made available in Live CD created by Barry Kauler with a very small size, i.e., 100 MB. 170 MB for the latest version. This distribution is designed for lightweight, reliable and easy to use while retaining maximum functionality.<\/p>\n\n\n\n<p>The entirety of OS and all programs can be loaded into RAM. This allows you to remove the boot media after initialization. It provides a package manager which facilitates the installation of new software such as big Linux distributions. This interface has installed \/ installable packages and automates installation \/ uninstallation, avoiding the often confusing process of manual installation.&nbsp;<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"10-centos\"><strong>10.&nbsp;CentOS<\/strong><\/h4>\n\n\n\n<p><strong>CentOS<\/strong>&nbsp;is one of the Linux distribution which is&nbsp; available freely (no license) and has strong and big community supported computing platform. Centos 5, 6, 7 and 8 versions will be maintained up to 10 years based on RHEL. There is no need to upgrade CENTOS to the next major and is not limited by upstream restrictions. There are 3 primary CENTOS repositories containing software packages that make CentOS distribution.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>base: This contain packages that form centos point releases and these are updated when actual release is available in form of ISO images<\/li>\n\n\n\n<li>updates: This contains packages and serves as security or enhanced updates etc for point release.<\/li>\n\n\n\n<li>addons: Contain packages required for building packages that make the main CentOS distribution but not provided by upstream.<\/li>\n<\/ol>\n\n\n\n<p><strong>Choosing a Linux distro<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><strong>distribution name<\/strong><\/td><td><strong>reason(s) for using<\/strong><\/td><\/tr><tr><td>Red Hat Enterprise (RHEL)<\/td><td>Used to want a good support contract.<\/td><\/tr><tr><td>CentOS<\/td><td>Used&nbsp; without the support contract from Red Hat.<\/td><\/tr><tr><td>Fedora<\/td><td>Want to have Red Hat on your laptop\/desktop.<\/td><\/tr><tr><td>Linux Mint<\/td><td>I want to have a personal graphical desktop to play music &amp;&nbsp; games movies.<\/td><\/tr><tr><td>Debian<\/td><td>Used for laptops, servers or any other device.<\/td><\/tr><tr><td>Ubuntu<\/td><td>Ubuntu based on Debian<\/td><\/tr><tr><td>Kali<\/td><td>Used to have a pointy-clicky&nbsp; or hacking interface.<\/td><\/tr><tr><td>others<\/td><td>Advanced users will prefer Arch, Gentoo, OpenSUSE, Scientific, ...<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"linux-bash\"><strong>Linux Bash<\/strong><\/h2>\n\n\n\n<p><strong>Bash (Bourne Again SHell)<\/strong> is a Unix shell and a command language interpreter(CLI). A shell is an interface and command line interpreter that executes commands. Bash shell packaged by default for most Linux distributions and is a successor for the Korn shell (KSH) and the C shell (csh).<\/p>\n\n\n\n<p>We can use bash on most Linux and OS X operating systems by using a terminal. Let\u2019s see a&nbsp; simple hello students example. Open up your terminal, and write the following line (everything after the $ sign):<\/p>\n\n\n\n<p><strong>abcxyz:~$ echo \"Hello students!\"<\/strong><\/p>\n\n\n\n<p><strong>Hello students!<\/strong><\/p>\n\n\n\n<p>We can see that we&nbsp;used the echo command to print the string \u201cHello students!\u201d to the terminal.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"writing-a-bash-script\"><strong>Writing a bash script<\/strong><\/h3>\n\n\n\n<p>We can put bash commands into a .sh file, and run them from the command line. Consider bash script with the following contents:<\/p>\n\n\n\n<p><strong>#!\/bin\/bash<\/strong><\/p>\n\n\n\n<p><strong>echo \"Hello students!\"<\/strong><\/p>\n\n\n\n<p>The first line starts with script&nbsp;#!&nbsp;and its special directive which Unix treats differently.<\/p>\n\n\n\n<p><strong>use of #!\/bin\/bash at&nbsp; beginning of the script file:<\/strong><\/p>\n\n\n\n<p>The first line indicates to Unix that the file is to be executed by \/bin\/bash. It is the standard location of the Bourne shell on just about every Unix system. Adding #!\/bin\/bash as the first line of the script tells the operating system to invoke the particular shell to execute the commands that follow in the script. #! and referred to as hash-bang, or she-bang or sha-bang, and it is executed only if we run the script as an executable.&nbsp;<\/p>\n\n\n\n<p>We can run the script to make the file executable and we call this command under sudo chmod +x \u2018filename\u2019.<\/p>\n\n\n\n<p><strong>abcxyz:~$ .\/myBashScript.sh<\/strong><\/p>\n\n\n\n<p><strong>Hello students!<\/strong><\/p>\n\n\n\n<p>The script only has two lines. The first indicates what interpreter to use to run the file (ex: bash). The second line is the command we want to use, echo, followed by what we want to print, which is \u201cHello students\u201d.<\/p>\n\n\n\n<p>Due to the permissions set on the file, sometimes we get an error in executing the script. So, it is recommended to use the following command:<\/p>\n\n\n\n<p>abcxyz:~$ chmod u+x myBashScript.sh<\/p>\n\n\n\n<p>After that, execute the script.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"linux-command-line-bash-cat\"><strong>Linux Command Line: Bash Cat<\/strong><\/h3>\n\n\n\n<p>Cat is used to read a file and print it to the standard output. It is derived from its function to concatenate files.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"usage\"><strong>Usage<\/strong><\/h3>\n\n\n\n<p>cat [options] [file_names]<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"example\"><strong>Example<\/strong><\/h3>\n\n\n\n<p>display in terminal the content of file.txt:<\/p>\n\n\n\n<p>cat file.txt<\/p>\n\n\n\n<p>Concatenate&nbsp; two files and display the result in terminal:<\/p>\n\n\n\n<p>cat file1.txt file2.txt<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"linux-command-line-bash-cd\"><strong>Linux Command Line: Bash cd<\/strong><\/h3>\n\n\n\n<p><strong>Change Directory<\/strong>&nbsp;to the path specified, for Ex:&nbsp;cd projects.<\/p>\n\n\n\n<p>There are a few helpful arguments for this:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>.&nbsp;refers to the current directory, such as&nbsp;.\/projects<\/li>\n\n\n\n<li>..&nbsp;to be used to move one folder up, use&nbsp;cd&nbsp; and can be combined to move up multiple levels&nbsp;i.e. ..\/..\/my-folder<\/li>\n\n\n\n<li>\/&nbsp;is the root of&nbsp; system to get core folders, such as&nbsp;system&nbsp;users.<\/li>\n\n\n\n<li>~&nbsp;is the home directory, and the path&nbsp;\/users\/username. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Move back to folders reference to relative to this path by including it at the start of path, for Ex:&nbsp;~\/projects.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"linux-command-line-bash-head\"><strong>Linux Command Line: Bash head<\/strong><\/h3>\n\n\n\n<p>Head is used to print the first ten lines (by default) or any other amount specified to a file or files. The head command allows you to view the first N lines of a file.<\/p>\n\n\n\n<p>If more than one file is called, then the first ten lines of each file are displayed unless a specific number of lines are specified. Choosing to display the file header is optional using the option below.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"usage\"><strong>Usage<\/strong><\/h3>\n\n\n\n<p>head [options] [file_name(s)]<\/p>\n\n\n\n<p>Most used options:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"example\"><strong>Example<\/strong><\/h3>\n\n\n\n<p>head file.txt<\/p>\n\n\n\n<p>Prints in terminal the first ten lines of file.txt (default)<\/p>\n\n\n\n<p>head -n 7 file.txt<\/p>\n\n\n\n<p>display in terminal the first 7 lines of file.txt<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"linux-command-line-bash-ls\"><strong>Linux Command Line: Bash ls<\/strong><\/h3>\n\n\n\n<p>ls&nbsp;is a command on Unix-like operating systems to list contents of a directory, for example folder and file names.<\/p>\n\n\n<figure class=\"wp-block-image size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/03\/image-36.png\"><img decoding=\"async\" width=\"737\" height=\"168\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/03\/image-36.png\" alt=\"\" class=\"wp-image-27929\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/03\/image-36.png 737w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/03\/image-36-300x68.png 300w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/03\/image-36-696x159.png 696w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/03\/image-36-150x34.png 150w\" sizes=\"(max-width: 737px) 100vw, 737px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"linux-command-line-bash-man\"><strong>Linux Command Line: Bash man<\/strong><\/h2>\n\n\n\n<p>Man, i.e. &nbsp;<strong>man<\/strong>ual, is a bash command used to display on-line reference manuals of the given command.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"usage\"><strong>Usage<\/strong><\/h3>\n\n\n\n<p>man [options] [command]<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"example\"><strong>Example<\/strong><\/h3>\n\n\n\n<p>Display the man page of ls:<\/p>\n\n\n\n<p>man ls<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"linux-command-line-bash-mv\"><strong>Linux Command Line: Bash mv<\/strong><\/h3>\n\n\n\n<p><strong>Moves files and folders.<\/strong><\/p>\n\n\n\n<p>mv source target<\/p>\n\n\n\n<p>The first argument is the file you want to move and the&nbsp; second is the location to move it to.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"arithmetic-operators-in-bash\"><strong>Arithmetic Operators in Bash:<\/strong><\/h3>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"mostly-used-arithmetic-operators-in-bash\">Mostly used Arithmetic Operators in Bash<\/h4>\n\n\n<figure class=\"wp-block-image aligncenter size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/03\/image-38.png\"><img decoding=\"async\" width=\"647\" height=\"268\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/03\/image-38.png\" alt=\"\" class=\"wp-image-27932\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/03\/image-38.png 647w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/03\/image-38-300x124.png 300w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/03\/image-38-150x62.png 150w\" sizes=\"(max-width: 647px) 100vw, 647px\" \/><\/figure>\n\n\n\n<p>Ex:<\/p>\n\n\n\n<p><strong>x=8&nbsp;&nbsp;,y=2&nbsp;&nbsp;<\/strong><\/p>\n\n\n\n<p><strong>echo&nbsp;\"x=8,&nbsp;y=2\"&nbsp;&nbsp;<\/strong><\/p>\n\n\n\n<p><strong>echo&nbsp;\"Addition&nbsp;of&nbsp;x&nbsp;&amp;&nbsp;y\"&nbsp;&nbsp;<\/strong><\/p>\n\n\n\n<p><strong>echo&nbsp;$((&nbsp;$x&nbsp;+&nbsp;$y&nbsp;))&nbsp;&nbsp;<\/strong><\/p>\n\n\n\n<p><strong>output : 10<\/strong><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"bash-string\"><strong>Bash String<\/strong><\/h3>\n\n\n\n<p>Bash String is a data type such as an integer or floating-point unit. It is used to represent text rather than numbers. It is a combination of a set of characters that may also contain numbers.<\/p>\n\n\n\n<p><strong>For example,<\/strong>&nbsp;the word \"GreatLearning\" and the phrase \"Welcome to Great Learning\" are the strings. Even \"01234\" could be considered as a string, if specified correctly.&nbsp;<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"bash-comments\"><strong>Bash Comments<\/strong><\/h3>\n\n\n\n<p>For single line comments in bash we should use hash symbol at the beginning&nbsp; (#).&nbsp;HashBung&nbsp;(#!) in the first line of the&nbsp;script file is the exception. Example: Bash Script with single line comments in between commands.<\/p>\n\n\n\n<p>Ex:&nbsp;<\/p>\n\n\n\n<p><strong>#!\/bin\/bash<\/strong><\/p>\n\n\n\n<p><strong>&nbsp;#&nbsp; single line comment in bash<\/strong><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"bash-array\"><strong>Bash Array<\/strong><\/h3>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"bash-array-declaration\"><strong>Bash Array Declaration<\/strong><\/h3>\n\n\n\n<p>To declare a variable&nbsp;as a Bash Array, use the keyword&nbsp;declare. The syntax is:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>&nbsp;declare&nbsp;-a&nbsp;ARRAY_NAME<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"bash-array-initialization\"><strong>Bash Array Initialization<\/strong><\/h3>\n\n\n\n<p>To initialize a Bash Array, use assignment operator&nbsp;=,&nbsp;and enclose all the elements inside braces&nbsp;(). The syntax to initialize a bash array is:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>&nbsp;ARRAY_NAME=(&nbsp;ELEMENT_1&nbsp;ELEMENT_2&nbsp;ELEMENT_N&nbsp;)<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>Access elements of Bash Array<\/p>\n\n\n\n<p>We can access the elements of&nbsp; Bash Array using the index.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>&nbsp;echo&nbsp;${ARRAY_NAME[2]}<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"print-bash-array-with-all-the-information\"><strong>Print Bash Array with all the information<\/strong><\/h3>\n\n\n\n<p>In order to print all the elements of a bash array along with all the index and details, use&nbsp;declare&nbsp;with option&nbsp;p. They syntax to print the bash array is:<\/p>\n\n\n\n<p>declare&nbsp;-p&nbsp;ARRAY_NAME<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"bash-for-loop\">Bash For Loop<\/h3>\n\n\n\n<p>It is&nbsp; used to perform repetitive tasks and&nbsp; helps us to iterate a particular set of statements over a series of words in a string\/elements in an array.<\/p>\n\n\n\n<p><strong>Syntax of For Loop:<\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nfor variable in list  \ndo  \ncommands  \ndone  \n\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"bash-if\"><strong>Bash If<\/strong><\/h3>\n\n\n\n<p>In BASHIF, if a particular condition is true, then only execute a given set of actions. If it is not true, then it will not execute those actions.&nbsp;<\/p>\n\n\n\n<p><strong>Syntax<\/strong>:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nif &#x5B; expression ];  \nthen  \nstatements  \nfi\n#!\/bin\/bash  \n  \nread-p &quot; Enter a No. of your choice : &quot; value  \n  \nif &#x5B; $value -gt 200 ]  \nthen  \necho &quot;entered No. is greater than 200&quot;  \nfi  \n\n<\/pre><\/div>\n\n\n<p><strong>Output:<\/strong><\/p>\n\n\n\n<p>Enter No. of your choice : 300<\/p>\n\n\n\n<p>The entered No. is greater&nbsp; than 200<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"bash-else-if\"><strong>Bash Else If<\/strong><\/h3>\n\n\n\n<p>Bash else-if statement is used for multiple conditions. In Bash elif, there are&nbsp; several elif blocks with a boolean expression for each one of them. In the case of the first 'if statement', if a condition goes false, then the second 'if condition' is checked.<\/p>\n\n\n\n<p>Syntax of Bash Else If (elif)<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nif &#x5B; condition ];  \nthen  \n&amp;lt;commands&gt;  \nelif &#x5B; condition ];  \nthen  \n&amp;lt;commands&gt;  \nelse  \n&amp;lt;commands&gt;  \nfi  \n\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"bash-case\"><strong>Bash Case<\/strong><\/h3>\n\n\n\n<p>The Bash case statement is the simplest form of IF-THEN-ELSE with many ELIF elements. Using the case statement makes our bash script more readable and easier to maintain. These are generally applied to simplify the complex conditions having multiple different choices.<\/p>\n\n\n\n<p><strong>Case Statement Syntax<\/strong><\/p>\n\n\n\n<p>Syntax of the bash case statement is given below:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ncase expression in  \n  pattern_1)  \n        statements  \n        ;;  \n    pattern_2)  \n        statements  \n        ;;  \n    pattern_3|pattern_4|pattern_5)  \n        statements  \n        ;;  \n    pattern-n)  \n        statements  \n        ;;  \n    *)  \n        statements  \n        ;;  \nesac  \n\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"bash-while-loop\"><strong>Bash While Loop<\/strong><\/h3>\n\n\n\n<p>The&nbsp;<strong>bash while loop<\/strong>&nbsp;can be defined as a control flow statement which allows executing the given set of commands repeatedly, as long as the applied condition evaluates to true. For example, we can either run echo command many times or just read a text file line by line and process the result by using while loop in Bash.<\/p>\n\n\n\n<p><strong>Syntax of While Loop:<\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nwhile &#x5B; expression ];  \ndo  \ncommands;  \nmultiple commands;  \ndone  \n\n<\/pre><\/div>\n\n\n<p>The above syntax is applicable only if the expression contains a single condition.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"bash-until-loop\"><strong>Bash Until Loop<\/strong><\/h3>\n\n\n\n<p><strong>Bash Until Loop<\/strong>&nbsp;in a bash scripting is used to execute a set of commands repeatedly based on the boolean result of an expression. The set of commands are executed only until the expression evaluates to true.<\/p>\n\n\n\n<p><strong>Syntax:<\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nuntil &#x5B; expression ];  \ndo  \ncommand1  \ncommand2  \n. . .  \n. . . .   \ncommandN  \ndone\n\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"set-environment-variable\"><strong>Set Environment Variable<\/strong><\/h2>\n\n\n\n<p>Environment variables are a set of key-value pairs stored on&nbsp; Linux systems used by processes to perform specific operations.&nbsp;<\/p>\n\n\n\n<p>Environment variables can also be used in shell programs or subshells to perform various operations (for example, knowing if the current user is the root or not).&nbsp;<\/p>\n\n\n\n<p>Environment variables in Linux have global\/local scope. A global scope environment variable can be accessed in a terminal from anywhere where a particular environment exists in the terminal, i.e. it can be used in all kinds of scripts \/programs \/process running in the env bound by that terminal, and the local scoped environment is defined in a terminal which cannot be accessed by any program \/process running in the terminal. It can be accessed only by the terminal.&nbsp;<\/p>\n\n\n\n<p>Syntax:$NAME<\/p>\n\n\n\n<p>Both Global\/local accessed in the same way.<\/p>\n\n\n\n<p>To&nbsp; display : $echo $name<\/p>\n\n\n\n<p>To display all environments : $printenv or $set or $env<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"set-environment-variables-on-linux-using-export\"><strong>Set Environment Variables on Linux using export<\/strong><\/h3>\n\n\n\n<p>On Linux, there are many different ways of setting environment variables.&nbsp;<\/p>\n\n\n\n<p>The best way to set environment variables is to use the&nbsp;export command.<\/p>\n\n\n\n<p>To set global environment :<\/p>\n\n\n\n<p>$ export VAR=\"value\" or set VAR=\u201dValue\u201d<\/p>\n\n\n\n<p>To Set local environment :&nbsp;<\/p>\n\n\n\n<p>$ NAME =Value<\/p>\n\n\n\n<p>Using export, the environment variable will set for the current shell session.<\/p>\n\n\n\n<p>If you open another shell or restart system, the environment variable won\u2019t be accessible anymore.&nbsp;<\/p>\n\n\n\n<p>To get the value of your environment variable, use the \u201cprintenv\u201d command with the variable.<\/p>\n\n\n\n<p>$ printenv &lt;variable&gt;<\/p>\n\n\n\n<p>Ex:<\/p>\n\n\n\n<p>$ printenv VAR<\/p>\n\n\n\n<p>value<\/p>\n\n\n\n<p>Alternatively, we can use&nbsp;Linux pipes&nbsp; to get the value of environment variables.<\/p>\n\n\n\n<p>We can also use the echo command but need a dollar sign before the variable name.<\/p>\n\n\n\n<p>$ echo $VAR<\/p>\n\n\n\n<p>Value<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"to-set-user-wide-envs\"><strong>To set user wide ENVs<\/strong><\/h3>\n\n\n\n<p>These variable are set and configured in ~\/.bashrc, ~\/.bash_profile, ~\/.bash_login, ~\/.profile<br>files according to the requirement.These variables can be accessed by a particular user and persist through power offs.<\/p>\n\n\n\n<p>Following steps can be followed to do so:<br>Step 1: Open the terminal.<br>Step 2:<\/p>\n\n\n\n<p>$ sudo vi ~\/.bashrc<\/p>\n\n\n\n<p>Step 3:Enter password.<br>Step 4:Add variable in the file opened.<\/p>\n\n\n\n<p>export NAME=Value<\/p>\n\n\n\n<p>Step 5: Save and close the file.<br>Step 6:<\/p>\n\n\n\n<p>$ source ~\/.bashrc&nbsp;<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"set-persistent-environment-variables-on-linux\"><strong>Set Persistent Environment Variables on Linux<\/strong><\/h3>\n\n\n\n<p>environment variables were not persistent over shell restarts.<\/p>\n\n\n\n<p>In order to&nbsp; make changes persistent use&nbsp; system files that are read and executed on specific conditions.<\/p>\n\n\n\n<p>Using the .bashrc file<\/p>\n\n\n\n<p>To set environment variables persistently it is better&nbsp; to add them to the \u201c.bashrc\u201d file and bashrc file script executed as and when &nbsp;we initialize an interactive shell session and&nbsp; launch a new Terminal via the GNOME interface or use a screen session.<\/p>\n\n\n\n<p>For Ex:&nbsp; add the following entries to your .bashrc file.<\/p>\n\n\n\n<p>$ export TZ=\"India\/Hyderabad\"<\/p>\n\n\n\n<p>training@debain:~cat .bashrc | tain \u2013n 10<\/p>\n\n\n\n<p># sources \/etc\/bash.bashrc).<\/p>\n\n\n\n<p>If ! shopt \u2013oq posix; then<\/p>\n\n\n\n<p>if [ -f\/usr\/share\/bash \u2013complete \/bash_complete ]; then<\/p>\n\n\n\n<p>elif [ -f \/etc\/bash_complete ]; then<\/p>\n\n\n\n<p>. \/etc\/ bash_complete<\/p>\n\n\n\n<p>fi<\/p>\n\n\n\n<p>fi<\/p>\n\n\n\n<p>export TZ=\u201dIndia\/Hyderabad\u201d<\/p>\n\n\n\n<p>training@debain:~$<\/p>\n\n\n\n<p>Save file and&nbsp;use the source command&nbsp;to reload the bashrc file for current shell session.<\/p>\n\n\n\n<p>$ source ~\/.bashrc<\/p>\n\n\n\n<p>We can print your new environment variable with \u201cprintenv\u201d andcheck how date was set on Linux&nbsp;by modifying TZ.<\/p>\n\n\n\n<p>$ printenv TZ<\/p>\n\n\n\n<p>India\/Hyderabad<\/p>\n\n\n\n<p>$ date<\/p>\n\n\n\n<p>Sat 19 Oct 2019 10:03:00 AM IST<\/p>\n\n\n\n<p>changes are now updated\/persistent over shell or system reloads.<\/p>\n\n\n\n<p>Using .bash_profile<\/p>\n\n\n\n<p>If we&nbsp; plan on connecting to sessions via \u201clogin shells\u201d, we can also add environment variables directly into the .bash_profile file.<\/p>\n\n\n\n<p>$ export TZ=\"India\/Hyderabad\"<\/p>\n\n\n\n<p>$ source ~\/.bash_profile<\/p>\n\n\n\n<p>Using etc\/environment<\/p>\n\n\n\n<p>If we want to enforce specific environment variables for everyone then define system-wide environment variables.<\/p>\n\n\n\n<p>To set system wide environment variables on Linux, we need to export our variables in the \/etc\/environment file.<\/p>\n\n\n\n<p>Ex: , To change the editor used globally, we can modify the EDITOR variable in the environment file.<\/p>\n\n\n\n<p>$ export EDITOR=\"vi\"<\/p>\n\n\n\n<p>training@debain:~$ cat\/etc\/environment<\/p>\n\n\n\n<p>export EDITOR=\u201dvi\u201d<\/p>\n\n\n\n<p>training@debain:~$<\/p>\n\n\n\n<p>Now login as different users on our system, and will see that the EDITOR variable is set for everybody on the server.<\/p>\n\n\n\n<p>manu@debian:~$ printenv EDITOR<\/p>\n\n\n\n<p>vi<\/p>\n\n\n\n<p>successfully set your environment variables persistently on Linux.<\/p>\n\n\n\n<p>Set Environment Variables in one line<\/p>\n\n\n\n<p>shortcuts in order to set them easily.<\/p>\n\n\n\n<p># One line for .bashrc<\/p>\n\n\n\n<p>$echo\"export &nbsp; VAR=\" value \"\"&gt;&gt; ~\/.bashrc&nbsp; &amp;&amp; source ~\/.bashrc<\/p>\n\n\n\n<p># One line for bash_profile<\/p>\n\n\n\n<p>$echo \u2018exprt VAR=\"value \u2018 &gt;&gt; ~\/.bash_profile &amp;&amp; source ~\/.bash_profile<\/p>\n\n\n\n<p># One line for \/etc\/environment<\/p>\n\n\n\n<p>$ echo \"export VAR=\"value\"\"&gt;&gt;\/etc\/environment &amp;&amp; source \/etc\/environment<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"unset-environment-variables-on-linux\"><strong>Unset Environment Variables on Linux<\/strong><\/h3>\n\n\n\n<p>In Linux, there are 2 ways of unsetting environment variables :&nbsp;i.e. by&nbsp; using 1)&nbsp;unset command&nbsp;2) by deleting variable entries our system files.<\/p>\n\n\n\n<p>unset command :<\/p>\n\n\n\n<p>Syntax to unset an environment variable, $ unset &lt;variable&gt;<\/p>\n\n\n\n<p>$ unset USERNAME<\/p>\n\n\n\n<p>$ printenv USERNAME<\/p>\n\n\n\n<p>&lt;nothing&gt;<\/p>\n\n\n\n<p>set -n command :<\/p>\n\n\n\n<p>unset environment variables using the set command with the \u201c-n\u201d flag.<\/p>\n\n\n\n<p>$ set -n USERNAME<\/p>\n\n\n\n<p>$ printenv USERNAME<\/p>\n\n\n\n<p>&lt;nothing&gt;<\/p>\n\n\n\n<p>Common Set of Environment Variables on Linux<\/p>\n\n\n\n<p><strong>USER: <\/strong>the current username using the system;<\/p>\n\n\n\n<p><strong>EDITOR:<\/strong> To perform file edits on your host;<\/p>\n\n\n\n<p><strong>HOME:&nbsp;<\/strong> home directory of the current user;<\/p>\n\n\n\n<p><strong>PATH:<\/strong> list of directories which are colon separated where the system looks for commands;<\/p>\n\n\n\n<p><strong>PS1:<\/strong> the primary prompt string&nbsp;<\/p>\n\n\n\n<p><strong>PWD:<\/strong> the current\/present working directory;<\/p>\n\n\n\n<p>Most recent command executed on the system&nbsp;<\/p>\n\n\n\n<p><strong>MAIL:<\/strong> used to send emails from command line&nbsp;<\/p>\n\n\n\n<p><strong>SHELL:<\/strong> the shell used in order to interpret commands on the system, i.e.&nbsp; bash, sh, zsh and others&nbsp;<\/p>\n\n\n\n<p><strong>LANG:<\/strong>&nbsp;language encoding used on the system;<\/p>\n\n\n\n<p><strong>DESKTOP_SESSION:<\/strong> the present desktop used on host (GNOME\/ KDE)<\/p>\n\n\n\n<p><strong>HISTFILESIZE: <\/strong>No. of lines of command history stored file;<\/p>\n\n\n\n<p><strong>HISTSIZE:<\/strong> No.of lines of history allowed in memory;<\/p>\n\n\n\n<p><strong>UID:<\/strong> the current UID for the user<\/p>\n\n\n\n<p>Set PATH environment variable on Linux<\/p>\n\n\n\n<p>To display current PATH environment variable, printenv command is used<\/p>\n\n\n\n<p>$ printenv PATH<\/p>\n\n\n\n<p>\/usr\/local\/bin:\/usr\/bin:\/bin:\/usr\/local\/games:\/usr\/games<\/p>\n\n\n\n<p>In order to&nbsp; set the PATH environment variable we should&nbsp; add an export line to our .bashrc file and source it.<\/p>\n\n\n\n<p>$echo\"export PATH=\"&lt;path&gt;:$PATH\"\" &gt;&gt; ~\/.bashrc &amp;&amp; source ~\/.bashrc<\/p>\n\n\n\n<p>$ printenv PATH<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"linux-set-command\"><strong>Linux Set command<\/strong><\/h2>\n\n\n\n<p>Linux set command is employed to set\/ unset certain flags\/settings within the shell environment. These flags and settings determine the behavior of an outlined script and help in executing the tasks without facing any issue. The values of shell attributes and parameters are often changed or displayed by using the set command.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"syntax\"><strong>Syntax<\/strong><\/h3>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"bourne-shell-sh\"><strong>Bourne shell (sh):<\/strong><\/h3>\n\n\n\n<p>set [--aefhkntuvx[<em>argument<\/em>]]...<\/p>\n\n\n\n<p><strong>C shell (csh):<\/strong><\/p>\n\n\n\n<p>set [<em>var<\/em>[=<em>value<\/em>]]<\/p>\n\n\n\n<p>set <em>var<\/em> [<em>n<\/em>] = <em>word<\/em><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"korn-shell-ksh\"><strong>Korn shell (ksh):<\/strong><\/h3>\n\n\n\n<p>set [+-aefhkmnopstuvx] [+-o <em>option<\/em>]... [+-A <em>name<\/em>] [<em>arg<\/em>...]<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"options-bourne-shell-sh\"><strong>Options: Bourne Shell (sh)<\/strong><\/h3>\n\n\n\n<p>In&nbsp;<strong>sh<\/strong>, the&nbsp;<strong>set<\/strong>&nbsp;built-in command has the below options:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><strong>--<\/strong><\/td><td>A double-dash (\"<strong>--<\/strong>\") option&nbsp; specifies the end of an option list. This option is&nbsp;mainly useful when values listed after the choices will start with a dash&nbsp;themselves.<\/td><\/tr><tr><td><strong>-a<\/strong><\/td><td>Mark variables that are edited or created for \"export\"; environment variables&nbsp;set during this way are going to be&nbsp; passed on to the environments of any subsequent&nbsp;commands.<\/td><\/tr><tr><td><strong>-e<\/strong><\/td><td>This option \u201cExit\u201d immediately if a command exits with a non-zero exit status.<\/td><\/tr><tr><td><strong>-f<\/strong><\/td><td>Disable file name generation (globbing).<\/td><\/tr><tr><td><strong>-h<\/strong><\/td><td>search and remember function commands as the functions are defined&nbsp;<\/td><\/tr><tr><td><strong>-k<\/strong><\/td><td>All arguments of KEYWORD &nbsp;are placed in the environment and not just those&nbsp;that precede the command name.<\/td><\/tr><tr><td><strong>-n<\/strong><\/td><td>It will&nbsp; not execute the command but read them.<\/td><\/tr><tr><td><strong>-t<\/strong><\/td><td>executes one command and exit after reading<\/td><\/tr><tr><td><strong>-u<\/strong><\/td><td>unset variables are treated as an error when substituting.<\/td><\/tr><tr><td><strong>-v<\/strong><\/td><td>display shell input lines on reading.<\/td><\/tr><tr><td><strong>-x<\/strong><\/td><td>display commands and their arguments as soon as&nbsp; they are executed.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>Using&nbsp;<strong>+<\/strong>&nbsp;instead of&nbsp;<strong>-<\/strong>&nbsp;causes these flags to be turned off. These flags&nbsp; also can be used to embellish the shell itself. The current set of flags could also&nbsp; be found within in the&nbsp;<strong>$-<\/strong>. variable The remaining arguments are place parameters and are given in respectively&nbsp;<strong>$1<\/strong>,&nbsp;<strong>$2<\/strong>, etc. If arguments are not&nbsp; given , values of all names are displayed.<\/p>\n\n\n\n<p>For every name, the&nbsp;<strong>unset<\/strong>&nbsp;command deletes the corresponding variable \/ function() value. The unique variables&nbsp;<strong>PATH<\/strong>,&nbsp;<strong>PS1<\/strong>,&nbsp;<strong>PS2<\/strong>,&nbsp;<strong>MAILCHECK<\/strong>, and&nbsp;<strong>IF<\/strong>&nbsp;cannot be unset.<\/p>\n\n\n\n<p>With the&nbsp;built-in <strong>export<\/strong>&nbsp; command, the given names are marked for automatic export to the environment of next&nbsp; executed commands. If no arguments are presented, variable names that are marked for export for the duration of the current shell's execution are listed. Function names aren\u2019t exported.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"options-c-shell-csh\"><strong>Options: C Shell (csh)<\/strong><\/h3>\n\n\n\n<p>In&nbsp;<strong>csh<\/strong>, If no arguments are mentioned,&nbsp;<strong>set<\/strong>&nbsp;prints the values of all shell variables. Multi-word values are printed as a parenthesized list. With the&nbsp;<em>var<\/em>&nbsp;argument alone,&nbsp;<strong>set<\/strong>&nbsp;assigns an null value to the variable&nbsp;<em>var<\/em>. <strong>set<\/strong>&nbsp;assigns value to&nbsp;<em>var<\/em> for the arguments of the type&nbsp;<em>var<\/em>&nbsp;<strong>=<\/strong>&nbsp;<em>value<\/em>.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><em>Word<\/em><\/td><td>A single word \/quoted&nbsp;string).<\/td><\/tr><tr><td><strong>(<\/strong><em>wordlist<\/em><strong>)<\/strong><\/td><td>list of words&nbsp; with space-separated enclosed in parentheses.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>Values are command\/file name expanded before they are&nbsp; assigned. The form&nbsp;<strong>set<\/strong>&nbsp;<em>var<\/em><strong>[<\/strong><em>n<\/em><strong>]=<\/strong><em>word<\/em>&nbsp;,&nbsp; the&nbsp;<em>nth<\/em> word in a multi word&nbsp;replaces <em>value<\/em>&nbsp;with&nbsp;<em>word<\/em>.<\/p>\n\n\n\n<p><strong>unset<\/strong>&nbsp;deletes variables whose names match&nbsp; pattern. All variables are deleted by \"<strong>unset *<\/strong>\"; this is a very bad practice&nbsp; if we don't know what we are doing.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"options-k-shell-ksh\"><strong>Options: K Shell (ksh)<\/strong><\/h3>\n\n\n\n<p>In&nbsp;<strong>ksh<\/strong>, the&nbsp;<strong>set<\/strong>&nbsp;command takes the below options:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><\/td><td><strong>-A<\/strong><\/td><td>Array&nbsp;assignment. Unset the variable name and assign values&nbsp;sequentially from the list arg. If&nbsp;<strong>+A<\/strong>&nbsp;is employed, the variable&nbsp;The name isn\u2019t unset first.<\/td><\/tr><tr><td><\/td><td><strong>-a<\/strong><\/td><td>subsequent parameters that are defined are automatically exported.<\/td><\/tr><tr><td><\/td><td><strong>-e<\/strong><\/td><td>If set and exists, execute the&nbsp;<strong>ERR<\/strong>&nbsp;trap&nbsp;if commands has non-zero&nbsp;Status and exit. This mode is disabled while reading profiles.<\/td><\/tr><tr><td><\/td><td><strong>-f<\/strong><\/td><td>Disables file name generation\/ substitution<\/td><\/tr><tr><td><\/td><td><strong>-h<\/strong><\/td><td>Designate&nbsp; command becomes a tracked alias when first encountered.<\/td><\/tr><tr><td><\/td><td><strong>-k<\/strong><\/td><td>Places parameter assignment arguments in environment&nbsp;to a&nbsp; command, not just whose arguments precede command name&nbsp;<br><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><\/td><td><strong>-m<\/strong><\/td><td>Background jobs would run in a different process group and a line&nbsp;and will print lines on completion. The exit status of these background&nbsp;jobs are reported on completion messages.&nbsp; systems with job&nbsp;control these flags are turned on automatically for interactive shells.<\/td><\/tr><tr><td><\/td><td><strong>-n<\/strong><\/td><td>This will read commands &amp; check them for syntactical errors, but don\u2019texecute them and also the flag is Ignored for interactive shells.<\/td><\/tr><tr><td><\/td><td><strong>-o<\/strong>&nbsp;<em>option<\/em><\/td><td>Print current&nbsp;<em>option<\/em>&nbsp;argument and if no option specify an arguments<br>Gives error messages.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><strong>Allexport<\/strong><\/td><td>Similar to &nbsp;<strong>\u2013a<\/strong> flag&nbsp;<\/td><\/tr><tr><td><strong>Errexit<\/strong><\/td><td>Similar to&nbsp;<strong>\u2013e<\/strong> flag<\/td><\/tr><tr><td><strong>Bgnice<\/strong><\/td><td>most background jobs are run at a lower priority,&nbsp;which is the&nbsp; default mode.<\/td><\/tr><tr><td><strong>Emacs<\/strong><\/td><td>enters in an&nbsp;<strong>emacs<\/strong> style in-line editor for command&nbsp;entry.&nbsp;<\/td><\/tr><tr><td><strong>Emacs<\/strong><\/td><td>enters in a&nbsp;<strong>gmacs<\/strong>-style in-line editor for command&nbsp;entry.<\/td><\/tr><tr><td><strong>ignoreeof<\/strong><\/td><td>The shell will not exit on&nbsp;end-of-file. Its command exit&nbsp;must be used.<\/td><\/tr><tr><td><strong>keyword<\/strong><\/td><td>Same as&nbsp;<strong>-k<\/strong>.flag<\/td><\/tr><tr><td><strong>markdirs<\/strong><\/td><td>Append slash(\/) for all director names that result of&nbsp;filename substitution.<\/td><\/tr><tr><td><strong>monitor<\/strong><\/td><td>Same as&nbsp;<strong>\u2013m<\/strong> flag<\/td><\/tr><tr><td><strong>noclobber<\/strong><\/td><td>Prevents redirection through truncating existing files.&nbsp;Use redirection symbol(<strong>&gt;|) right care pipe)<\/strong> to truncate a file when turned on.<\/td><\/tr><tr><td><strong>Noexec<\/strong><\/td><td>Same as&nbsp;<strong>-n<\/strong>.<\/td><\/tr><tr><td><strong>Noglob<\/strong><\/td><td>Same as&nbsp;<strong>-f<\/strong>.<\/td><\/tr><tr><td><strong>Nolog<\/strong><\/td><td>Don\u2019t save in history file the function definitions<\/td><\/tr><tr><td><strong>nounset<\/strong><\/td><td>Same as&nbsp;<strong>-u<\/strong>.<\/td><\/tr><tr><td><strong>privileged<\/strong><\/td><td>Same as&nbsp;<strong>-p<\/strong>.<\/td><\/tr><tr><td><strong>Verbose<\/strong><\/td><td>Same as&nbsp;<strong>-v<\/strong>.<\/td><\/tr><tr><td><strong>Trackall<\/strong><\/td><td>Same as&nbsp;<strong>-h<\/strong>.<\/td><\/tr><tr><td><strong>Vi<\/strong><\/td><td>Puts you in insert mode of a&nbsp;vi-style in-line editor till we&nbsp;hit&nbsp;escape. This option argument puts you in&nbsp;control mode. A&nbsp;return&nbsp;sends the line.<\/td><\/tr><tr><td><strong>Viraw<\/strong><\/td><td>processed every character is as it is typed in&nbsp;<strong>vi<\/strong>&nbsp;mode.<\/td><\/tr><tr><td><strong>Xtrace<\/strong><\/td><td>Same as&nbsp;<strong>-x<\/strong>.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>If no option name is supplied then the present option settings are&nbsp;printed.<\/p>\n\n\n\n<p>Using&nbsp;<strong>+<\/strong>&nbsp;instead of &nbsp;<strong>-<\/strong>&nbsp;causes above flags to be turned off. These flags can also be used upon invocation of the shell. The present set of flags may be found in&nbsp;<strong>$-<\/strong>. until&nbsp;<strong>-A<\/strong>&nbsp;is specified, the remaining arguments are positional parameters and are assigned, in order, to \"<strong>$1 $2<\/strong>&nbsp;...\".&nbsp;<\/p>\n\n\n\n<p>Using <strong>+<\/strong> instead of&nbsp; <strong>-<\/strong> causes the above flags to be turned off. These flags can also be used upon invocation of the shell. The present set of flags may be found in <strong>$-<\/strong>. until <strong>-A<\/strong> is specified. The remaining arguments are positional parameters and are assigned, in order, to \"<strong>$1 $2<\/strong> ...\". If no arguments are specified, then the names and values of all variables are displayed on the standard output.<\/p>\n\n\n\n<p>The variables given by the list of names are automatically unassigned; their values and attributes are deleted. Read-only variables cannot be <strong>unset<\/strong>. If the <strong>-f<\/strong>-flag is set, then the names point out to function names.<\/p>\n\n\n\n<p>While using <strong>unset<\/strong>, the variables given by the array of names, in the same way, are unassigned, and their values &amp; attributes are deleted, and read-only variables can't be <strong>unsent<\/strong>.<\/p>\n\n\n\n<p>With the <strong>built-in export<\/strong> command, the said names are marked for automatic export to the environment next to -executed commands. <strong>KSH<\/strong> commands that are preceded by one \/two \"<strong>*<\/strong>\" characters are treated specifically in the following ways:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Variable assignment lists preceding the command stay in effect when the command completes.<\/li>\n\n\n\n<li>Input or Output redirections are processed next to variable assignments.<\/li>\n\n\n\n<li>Errors can cause a script that contains them to abort.<\/li>\n\n\n\n<li>Words following a command or preceded by <strong>**<\/strong> that is in the form of a variable assignment, expanded with the same rules as a variable assignment. This assignment that is tilde (~), is performed after the <strong>equal <\/strong>sign and word splitting and file name generation are not performed.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"examples\"><strong>Examples:<\/strong><\/h3>\n\n\n\n<p>set PATH=\"\/bin:\/usr\/bin:\/usr\/sbin:usr\/local\/bin\"<\/p>\n\n\n\n<p>In&nbsp;<strong>csh<\/strong>, the command sets the environment variable&nbsp;<strong>PATH<\/strong>, so that&nbsp; shell can&nbsp; search for files in the&nbsp;&nbsp; <strong>\/bin<\/strong>, &nbsp;<strong>\/usr\/bin<\/strong>, &nbsp;<strong>\/usr\/sbin<\/strong>&nbsp; and&nbsp; <strong>\/usr\/local\/bin<\/strong>&nbsp;directories, in those order.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"linux-export-command\"><strong>Linux Export Command<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"introduction\"><strong>Introduction<\/strong><\/h3>\n\n\n\n<p>Linux export commands make a variable something that will be included in the child process environment. It will not affect other already existing environments. There is no way to set variables in one terminal and have them automatically appear in another terminal. The environment is established for each process on its own.&nbsp;<\/p>\n\n\n\n<p>The<strong> export<\/strong> command is bash shell BUILTINS commands, i.e. it is part of the shell. The <strong>export<\/strong> command is easy to use, and it has direct syntax with only three available command options. The shell gives the export attribute to the variables associated with the required names that cause them to be an environment of subsequently executed commands.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"frequently-used-options\"><strong>Frequently Used Options<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>-p<\/strong><br>List&nbsp; all names that are exported in the current shell<\/li>\n\n\n\n<li><strong>-n<\/strong><br>Remove names from export list<\/li>\n\n\n\n<li><strong>-f<\/strong><br>Names are exported as functions<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"export-basics\"><strong>Export basics<\/strong><\/h3>\n\n\n\n<p>For example:<\/p>\n\n\n\n<p>$ ai=greatlearning.in<\/p>\n\n\n\n<p>$ echo $ai<\/p>\n\n\n\n<p>greatlearning.in<\/p>\n\n\n\n<p>$ bash<\/p>\n\n\n\n<p>$ echo $ai<\/p>\n\n\n\n<p>$<\/p>\n\n\n\n<p>Line 1:&nbsp; new variable called \"ai\" is created&nbsp; with string \"greatlearning.in\"<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Line 2: echo command to print out a contents of the variable \"ai\"<\/li>\n\n\n\n<li>Line 3:&nbsp; created a new child bash shell<\/li>\n\n\n\n<li>Line 4: variable \"ai\" have no any values defined<\/li>\n<\/ul>\n\n\n\n<p>It can be seen from above, any new child process forked from a parent process by default does not inherit parent's variables. This is where the&nbsp;<strong>export<\/strong>&nbsp;command is used.&nbsp; Ex: &nbsp;<strong>export<\/strong>&nbsp;command<\/p>\n\n\n\n<p>$ ai=greatlearning.in<\/p>\n\n\n\n<p>$ echo $ai<\/p>\n\n\n\n<p>greatlearning.in<\/p>\n\n\n\n<p>$ export ai&nbsp;<\/p>\n\n\n\n<p>$ bash&nbsp;<\/p>\n\n\n\n<p>$ echo $ai<\/p>\n\n\n\n<p>Greatlearning.in<\/p>\n\n\n\n<p>$<\/p>\n\n\n\n<p>In line three, we used the <strong>export<\/strong> command to make the variable \"ai\" to be exported whenever a new child process is created. Thus, the variable \"ai\" still contains the string \"greatlearning.in\" even though a new bash shell was created. It is worth mentioning that in order to export the variable \"ai\" to be available in a new process, the process must be forked from the parent process where the actual variable was exported. The relationship between the child and parent process is detailed below.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"child-vs-parent-process\"><strong>Child vs Parent process<\/strong><\/h3>\n\n\n\n<p>Any process is often a parent and child process at an equivalent time. But one exception is that the&nbsp;<strong>init<\/strong>&nbsp;process, which is usually&nbsp; marked with PID ( process ID ) 1. Therefore,&nbsp;<strong>init<\/strong>&nbsp;may be a parent of all processes running on your Linux system.<\/p>\n\n\n\n<p>$ ps \u2013p 1<\/p>\n\n\n\n<p>PID TTY &nbsp; &nbsp; &nbsp; TIME CMD<\/p>\n\n\n\n<p>1? &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 00:00:03 init<\/p>\n\n\n\n<p>Any process created will normally have a parent process from which it was created and will be considered as a child of this parent process.&nbsp; example:<\/p>\n\n\n\n<p>$ echo $$<\/p>\n\n\n\n<p>27860<\/p>\n\n\n\n<p>$ bash<\/p>\n\n\n\n<p>$ echo $$<\/p>\n\n\n\n<p>28030<\/p>\n\n\n\n<p>$ ps - -ppid 27860<\/p>\n\n\n\n<p>PID TTY &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; TIME CMD<\/p>\n\n\n\n<p>28030 pts\/2&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 00:00:00 bash<\/p>\n\n\n\n<p>Line 1: print a PID for a current shell - 27860<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Line 2: A new child process created from the process ID 27860<\/li>\n\n\n\n<li>Line 3: Display a PID for a current shell - 28030<\/li>\n\n\n\n<li>Line 4: With use of the&nbsp;<strong>ps<\/strong>&nbsp;command print the child process of PID 27860<\/li>\n<\/ul>\n\n\n\n<p>While creating a new child process an&nbsp;<strong>export<\/strong>&nbsp;command ensures that any exported variables in the parent process are also available in the child process.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"using-export-command\"><strong>Using export command<\/strong><\/h3>\n\n\n\n<p>Now that we\u2019ve learned some basics, we will still need to explore the <strong>export<\/strong> command comprehensively. When using the <strong>export<\/strong> command with no option and arguments, it\u2019ll simply print all names marked for export to a toddler process. This is the equivalent when using the -p option:<\/p>\n\n\n\n<p>$ export<\/p>\n\n\n\n<p>declare&nbsp; \u2013x COLORFGBG =\u201d15;0\u201d<\/p>\n\n\n\n<p>declare&nbsp; \u2013x DEFAULTS_PATH=\u201d\/usr\/share\/gconf\/cinnamon.default.path\u201d<\/p>\n\n\n\n<p>declare&nbsp; -x DESKTOP_SESSION=\u201dcinnamon\u201d<\/p>\n\n\n\n<p>declare&nbsp; -x DISPLAY =\u201d:0\u201d. . . . .&nbsp;&nbsp;<\/p>\n\n\n\n<p>As shown before, to export a variable we just use the variable's name as an argument to an export command.<\/p>\n\n\n\n<p>$ MYVAR =10<\/p>\n\n\n\n<p>$ export | grep MYVAR<\/p>\n\n\n\n<p>$ export MYVAR<\/p>\n\n\n\n<p>$ export | grep MYVAR<\/p>\n\n\n\n<p>declare \u2013x MYVAR=\u201d10\u201d<\/p>\n\n\n\n<p>As you\u2019ll see, once the MYVAR variable is exported it will show up within the&nbsp; list of exported variables ( line 4 ). The above example are often shortened by using the&nbsp;<strong>export<\/strong>&nbsp;command directly with variable assessment.<\/p>\n\n\n\n<p>$ export MYVAR =10<\/p>\n\n\n\n<p>$ export | grep MYVAR<\/p>\n\n\n\n<p>Declare \u2013x MYVAR =\u201d10\u201d<\/p>\n\n\n\n<p>The commonly&nbsp;<strong>export<\/strong>&nbsp;command is when defining the \/PATH shell variable:<\/p>\n\n\n\n<p>export PATH =$PATH:\/usr\/local\/bin<\/p>\n\n\n\n<p>In the example above, we\u2019 ve included an additional path \/usr\/local\/bin to the prevailing PATH definition.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"exporting-a-shell-function\"><strong>Exporting a shell function<\/strong><\/h3>\n\n\n\n<p>With the choice of the&nbsp;<strong>export<\/strong>&nbsp;command can be implemented to export functions. In the example below, we will create a new bash function called&nbsp;<em>printname,<\/em>&nbsp;which can simply use the&nbsp;<strong>echo<\/strong>&nbsp;command to print the string \"greatlearning.in\".<\/p>\n\n\n\n<p>$ printname () { echo \u201cgreatlearning.in\u201d }<\/p>\n\n\n\n<p>$ printname<\/p>\n\n\n\n<p>greatlearning.in<\/p>\n\n\n\n<p>$ export \u2013f printname<\/p>\n\n\n\n<p>$ bash<\/p>\n\n\n\n<p>$ printname<\/p>\n\n\n\n<p>greatlearning.in<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"removing-names-from-export-list\"><strong>Removing names from export list<\/strong><\/h3>\n\n\n\n<p>In the above example, we&nbsp; now have the MYVAR variable defined in our export list.<\/p>\n\n\n\n<p>$ export | grep MYVAR<\/p>\n\n\n\n<p>Declare \u2013x MYVAR =\u201d10\u201d<\/p>\n\n\n\n<p>To delete this variable from the export list we should&nbsp; use the -n export option.<\/p>\n\n\n\n<p>$ export | grep MYVAR<\/p>\n\n\n\n<p>Declare \u2013x MYVAR=\u201d10\u201d<\/p>\n\n\n\n<p>$ export \u2013n MYVAR<\/p>\n\n\n\n<p>$ export | grep MYVAR<\/p>\n\n\n\n<p>$<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"linux-commands-list\"><strong>Linux commands list<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><strong>Command<\/strong><\/td><td><strong>Description<\/strong><\/td><\/tr><tr><td>Adduser<\/td><td>Add a new user<\/td><\/tr><tr><td>Aspell<\/td><td>The&nbsp;<em>aspell<\/em>&nbsp;command used to&nbsp; &nbsp;spell check on a text file.&nbsp;<\/td><\/tr><tr><td>Basename<\/td><td>basename command used to&nbsp; strip off components from filenames that aren't required.<\/td><\/tr><tr><td>Bzip2<\/td><td>This&nbsp; command is used to create compressed file archives in bzip2 format.&nbsp;<\/td><\/tr><tr><td>Cpulimit<\/td><td>It is a tool that limits the CPU usage of a process. It is also useful to control batch jobs if we don\u2019t want to eat too many CPU cycles.&nbsp;<\/td><\/tr><tr><td>arch<\/td><td>Print machine architecture<\/td><\/tr><tr><td>Awk<\/td><td>Find and Replace text within file(s)<\/td><\/tr><tr><td>Bc<\/td><td>An arbitrary precision calculator language<\/td><\/tr><tr><td>cal<\/td><td>Display a calendar<\/td><\/tr><tr><td>cat<\/td><td>Concatenate files and print on the standard output<\/td><\/tr><tr><td>chdir<\/td><td>Change working directory<\/td><\/tr><tr><td>chgrp<\/td><td>Change the group ownership of files<\/td><\/tr><tr><td>chkconfig<\/td><td>Tool for maintaining the \/etc\/rc[0-6].d directory hierarchy<\/td><\/tr><tr><td>chmod<\/td><td>It will modify the access permissions of files and directories<\/td><\/tr><tr><td><a href=\"https:\/\/www.mediacollege.com\/linux\/command\/chown.html\" rel=\"nofollow\">chown<\/a><\/td><td>Change the user and group ownership of files<\/td><\/tr><tr><td>chroot<\/td><td>Change root directory<\/td><\/tr><tr><td>cksum<\/td><td>Print CRC checksum and byte counts<\/td><\/tr><tr><td>clear<\/td><td>Clear terminal screen<\/td><\/tr><tr><td>cmp<\/td><td>Compare two files<\/td><\/tr><tr><td>comm<\/td><td>Compare two sorted files line by line<\/td><\/tr><tr><td>cp<\/td><td>Copy one\/ more files from line location to&nbsp; another&nbsp;<\/td><\/tr><tr><td>Csh<\/td><td>The&nbsp;<em>csh<\/em>&nbsp;command is used to move between Linux user shells.&nbsp;<\/td><\/tr><tr><td>cron<\/td><td>Daemon to execute scheduled commands<\/td><\/tr><tr><td>crontab<\/td><td>Is used to run list of commands at regular schedule<\/td><\/tr><tr><td>csplit<\/td><td>Split a file into context-determined pieces<\/td><\/tr><tr><td>cut<\/td><td>Divide a file into several parts<\/td><\/tr><tr><td>curl<\/td><td>used to download files from the internet by HTTP\/HTTPS.&nbsp;<\/td><\/tr><tr><td>Dig<\/td><td>used to query DNS servers and for resolving DNS records.&nbsp;<\/td><\/tr><tr><td>date<\/td><td>Display or change the date &amp; time<\/td><\/tr><tr><td>dc<\/td><td>Desk Calculator<\/td><\/tr><tr><td>dd<\/td><td>Data Dump - Convert &amp; copy a file<\/td><\/tr><tr><td>df<\/td><td>Display free disk space<\/td><\/tr><tr><td>diff<\/td><td>Display the differences between two files<\/td><\/tr><tr><td>diff3<\/td><td>Show differences among three files<\/td><\/tr><tr><td>dir<\/td><td>Briefly list directory contents<\/td><\/tr><tr><td>dircolors<\/td><td>Colour setup for `ls'<\/td><\/tr><tr><td>dirname<\/td><td>Convert&nbsp; full pathname to a path<\/td><\/tr><tr><td>du<\/td><td>Estimate file space usage<\/td><\/tr><tr><td>echo<\/td><td>Display message on screen<\/td><\/tr><tr><td>ed<\/td><td>A line-oriented text editor (edlin)<\/td><\/tr><tr><td>egrep<\/td><td>pattern searching command that match an extended expression<\/td><\/tr><tr><td>eject<\/td><td>Eject CD-ROM<\/td><\/tr><tr><td>env<\/td><td>Display, set, or remove environment variables<\/td><\/tr><tr><td>expand<\/td><td>Convert tabs to spaces<\/td><\/tr><tr><td>expr<\/td><td>Evaluate expressions<\/td><\/tr><tr><td>factor<\/td><td>Print prime factors<\/td><\/tr><tr><td>false<\/td><td>Do nothing, unsuccessfully<\/td><\/tr><tr><td>fdformat<\/td><td>Low-level format a floppy disk<\/td><\/tr><tr><td>fdisk<\/td><td>Partition table manipulator for Linux<\/td><\/tr><tr><td>fgrep<\/td><td>Used for to search fixed character string in file(s)&nbsp;<\/td><\/tr><tr><td>find<\/td><td>Search\/locate&nbsp; for files that based a desired criteria<\/td><\/tr><tr><td>fmt<\/td><td>Reformat paragraph text<\/td><\/tr><tr><td>fold<\/td><td>Wrap text to fit a specified width<\/td><\/tr><tr><td>format<\/td><td>Format disks or tapes<\/td><\/tr><tr><td>free<\/td><td>Display memory usage<\/td><\/tr><tr><td>fsck<\/td><td>Filesystem consistency check and repair<\/td><\/tr><tr><td>gawk<\/td><td>Find and Replace text within file(s)<\/td><\/tr><tr><td>grep<\/td><td>Used for Searching&nbsp; plaintext data sets that match a given pattern<\/td><\/tr><tr><td>groups<\/td><td>Print group names a user is in<\/td><\/tr><tr><td>gzip<\/td><td>Compress or decompress named file(s)<\/td><\/tr><tr><td>head<\/td><td>Output the first part of file(s)<\/td><\/tr><tr><td>hostname<\/td><td>Print or set system name<\/td><\/tr><tr><td>id<\/td><td>Print user and group ids<\/td><\/tr><tr><td>info<\/td><td>Help info<\/td><\/tr><tr><td>install<\/td><td>Copy files and set attributes<\/td><\/tr><tr><td>join<\/td><td>Join lines on a common field<\/td><\/tr><tr><td>kill<\/td><td>Stop a process from running<\/td><\/tr><tr><td>less<\/td><td>Display output one screen at a time<\/td><\/tr><tr><td>ln<\/td><td>Make links between files<\/td><\/tr><tr><td>locate<\/td><td>Find files<\/td><\/tr><tr><td>logname<\/td><td>Print current login name<\/td><\/tr><tr><td>lpc<\/td><td>Line printer control program<\/td><\/tr><tr><td>lpr<\/td><td>Off line print<\/td><\/tr><tr><td>lprm<\/td><td>Remove jobs from the print queue<\/td><\/tr><tr><td>ls<\/td><td>List information about file(s)<\/td><\/tr><tr><td>man<\/td><td>Help manual<\/td><\/tr><tr><td>mkdir<\/td><td>Create new folder(s)<\/td><\/tr><tr><td>mkfifo<\/td><td>Make FIFOs (named pipes)<\/td><\/tr><tr><td>mknod<\/td><td>Make block or character special files<\/td><\/tr><tr><td>more<\/td><td>Display output one screen at a time<\/td><\/tr><tr><td>mount<\/td><td>Mount a file system<\/td><\/tr><tr><td>mv<\/td><td>Move or rename files or directories<\/td><\/tr><tr><td>nice<\/td><td>Used to start process with specified value<\/td><\/tr><tr><td>nl<\/td><td>Number lines and write files<\/td><\/tr><tr><td>nohup<\/td><td>Run a command immune to hang-ups<\/td><\/tr><tr><td>passwd<\/td><td>Modify a user password<\/td><\/tr><tr><td>paste<\/td><td>Merge lines of files<\/td><\/tr><tr><td>pathchk<\/td><td>Check file name portability<\/td><\/tr><tr><td>pr<\/td><td>Convert text files for printing<\/td><\/tr><tr><td>printcap<\/td><td>Printer capability database<\/td><\/tr><tr><td>printenv<\/td><td>Print environment variables<\/td><\/tr><tr><td>printf<\/td><td>Format and print data<\/td><\/tr><tr><td>ps<\/td><td>Process status<\/td><\/tr><tr><td>pwd<\/td><td>Print Working Directory<\/td><\/tr><tr><td>Ping<\/td><td>Used to&nbsp; check connection to server<\/td><\/tr><tr><td>quota<\/td><td>Display disk usage and limits<\/td><\/tr><tr><td>quotacheck<\/td><td>Scan a file system for disk usage<\/td><\/tr><tr><td>quotactl<\/td><td>Set disk quotas<\/td><\/tr><tr><td>ram<\/td><td>ram disk device<\/td><\/tr><tr><td>rcp<\/td><td>Copy files between two machines<\/td><\/tr><tr><td>rm<\/td><td>Remove files<\/td><\/tr><tr><td>rmdir<\/td><td>Remove folder(s)<\/td><\/tr><tr><td>rpm<\/td><td>Remote Package Manager<\/td><\/tr><tr><td>rsync<\/td><td>Remote file copy (Synchronize file trees)<\/td><\/tr><tr><td>screen<\/td><td>Terminal window manager<\/td><\/tr><tr><td>sdiff<\/td><td>Merge two files interactively<\/td><\/tr><tr><td>sed<\/td><td>Stream Editor<\/td><\/tr><tr><td>select<\/td><td>Accept keyboard input<\/td><\/tr><tr><td>seq<\/td><td>Print numeric sequences<\/td><\/tr><tr><td>shutdown<\/td><td>Shutdown or restart linux<\/td><\/tr><tr><td>sleep<\/td><td>Delay for a specified time<\/td><\/tr><tr><td>sort<\/td><td>Sort text files<\/td><\/tr><tr><td>split<\/td><td>Split a file into fixed-size pieces<\/td><\/tr><tr><td>su<\/td><td>Substitute user identity<\/td><\/tr><tr><td>sum<\/td><td>Print a checksum for a file<\/td><\/tr><tr><td>symlink<\/td><td>Make a new name for a file<\/td><\/tr><tr><td>sync<\/td><td>Synchronize data on disk with memory<\/td><\/tr><tr><td>tac<\/td><td>Concatenate and write files in reverse<\/td><\/tr><tr><td>tail<\/td><td>Output the last part of files<\/td><\/tr><tr><td>tar<\/td><td>Tape Archiver<\/td><\/tr><tr><td>tee<\/td><td>Redirect output to multiple files<\/td><\/tr><tr><td>test<\/td><td>Evaluate a conditional expression<\/td><\/tr><tr><td>time<\/td><td>Measure Program Resource Use<\/td><\/tr><tr><td>touch<\/td><td>Change file timestamps<\/td><\/tr><tr><td>top<\/td><td>List processes running on the system<\/td><\/tr><tr><td>traceroute<\/td><td>Trace Route to Host<\/td><\/tr><tr><td>tr<\/td><td>Translate, squeeze, and\/or delete characters<\/td><\/tr><tr><td>true<\/td><td>Do nothing, successfully<\/td><\/tr><tr><td>tsort<\/td><td>Topological sort<\/td><\/tr><tr><td>tty<\/td><td>Print filename of terminal on stdin<\/td><\/tr><tr><td>umount<\/td><td>Unmount a device<\/td><\/tr><tr><td>Umask<\/td><td>Command for user files creation mask<\/td><\/tr><tr><td>uname<\/td><td>Print system information<\/td><\/tr><tr><td>unexpand<\/td><td>Convert spaces to tabs<\/td><\/tr><tr><td>uniq<\/td><td>Uniquify files<\/td><\/tr><tr><td>units<\/td><td>Convert units from one scale to another<\/td><\/tr><tr><td>unshar<\/td><td>Unpack shell archive scripts<\/td><\/tr><tr><td>useradd<\/td><td>Create new user account<\/td><\/tr><tr><td>usermod<\/td><td>Modify user account<\/td><\/tr><tr><td>users<\/td><td>List users currently logged in<\/td><\/tr><tr><td>uuencode<\/td><td>Encode a binary file<\/td><\/tr><tr><td>uudecode<\/td><td>Decode a file created by uuencode<\/td><\/tr><tr><td>vdir<\/td><td>Verbosely list directory contents (`ls -l -b')<\/td><\/tr><tr><td>watch<\/td><td>Execute\/display a program periodically<\/td><\/tr><tr><td>wc<\/td><td>Print byte, word, and line counts<\/td><\/tr><tr><td>whereis<\/td><td>Report all known instances of a command<\/td><\/tr><tr><td>which<\/td><td>Locate\/Search a program file in the user's path<\/td><\/tr><tr><td>who<\/td><td>Display all usernames that currently logged in<\/td><\/tr><tr><td>whoami<\/td><td>Display the current user ID and name&nbsp;<\/td><\/tr><tr><td>Users<\/td><td>Display user names of currently logged in&nbsp;<\/td><\/tr><tr><td>Userdel<\/td><td>Command deletes user account<\/td><\/tr><tr><td>Unalias<\/td><td>Delete an alias<\/td><\/tr><tr><td>xargs<\/td><td>Execute utility &amp; passing construct argument list(s)<\/td><\/tr><tr><td>yes<\/td><td>Display a&nbsp; string until interrupted<\/td><\/tr><tr><td>What is&nbsp;<\/td><td>Shows\/search online manual page description<\/td><\/tr><tr><td>Wget<\/td><td>Used to download files from web<\/td><\/tr><tr><td>Wall<\/td><td>Used to send or display message to all users<\/td><\/tr><tr><td>Youtube-dl<\/td><td>Used to download videos<\/td><\/tr><tr><td>zcmp\/zdiff<\/td><td>Used to compare compressed files<\/td><\/tr><tr><td>Zz<\/td><td>This commands offers quick access to files and directories&nbsp;<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"linux-commands-with-examples\"><strong>Linux commands with examples<\/strong><\/h2>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"1-ls\"><strong>1.&nbsp; ls<\/strong><\/h4>\n\n\n\n<p>$ ls<\/p>\n\n\n\n<p>This command shows a list of all the files and directories present in the current working directory.<\/p>\n\n\n\n<p>$ ls ~<\/p>\n\n\n\n<p>This command shows the list of files that are present in the home directory.<\/p>\n\n\n\n<p>$ ls -ltr<\/p>\n\n\n\n<p>This command will display the file having the name mentioned in the command and will give details of that file.<\/p>\n\n\n\n<p>$ ls \u2013ltr<\/p>\n\n\n\n<p>This command will list all files in the order of time in which they were created.&nbsp; The terms \u201cltr\u201d stand for l:&nbsp; long listing, t : time, r: recursive.&nbsp;<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"2-df\"><strong>2.df<\/strong><\/h4>\n\n\n\n<p>$ df<\/p>\n\n\n\n<p>\u201cdf\u201d is a \u201cdisk file system\u201d.&nbsp; This command shows a summary list of the total disk space available and the used disk space on the file.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/p>\n\n\n\n<p>$ df -h<\/p>\n\n\n\n<p>\u2018-h\u2019 parameter is used to display the summary of the total disk space used and available on your Linux file system in MB\/GB.&nbsp;<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"3-mkdir\"><strong>3.mkdir<\/strong><\/h4>\n\n\n\n<p>$ mkdir<\/p>\n\n\n\n<p>Used to create a new directory on Linux file system. For Ex:- mkdir greatlearning&nbsp; will create a new directory named \u201cgreatlearning\u201d.&nbsp;<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"4-rm\"><strong>4.rm<\/strong><\/h4>\n\n\n\n<p>$ rm<\/p>\n\n\n\n<p>Used to remove a file from your Linux file system.&nbsp;<\/p>\n\n\n\n<p>For example- \u201crm data\u201d, this will remove file named data present in the current working directory.<\/p>\n\n\n\n<p>$ rmdir<\/p>\n\n\n\n<p>Used to remove a complete directory from the Linux file system.<\/p>\n\n\n\n<p>For example- \u201crmdir allstuffs\u201d will delete the allstuffs directory from the Linux file system.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"5-pwd\"><strong>5.pwd<\/strong><\/h4>\n\n\n\n<p>$ pwd<\/p>\n\n\n\n<p>\u201cpwd\u201d stands for \u201cPresent Working Directory\u201d. It will display the directory name on which you are currently present or working and also shows the path of that directory.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"6-cd\"><strong>6. cd<\/strong><\/h4>\n\n\n\n<p>$ cd<\/p>\n\n\n\n<p>\u201ccd\u201d stands for&nbsp; change directory.&nbsp; By this command, a user can easily navigate to the directory of his choice at any moment of time. cd command changes the present working directory, to the directory name specified by the user in which he wants to navigate.<\/p>\n\n\n\n<p>$ cd \/<\/p>\n\n\n\n<p>This is&nbsp; used to navigate to the root directory of a user's Linux file system.<\/p>\n\n\n\n<p>$ cd ~<\/p>\n\n\n\n<p>This command is used to go to the home directory.<\/p>\n\n\n\n<p>$ cd..<\/p>\n\n\n\n<p>This command is used to navigate to one directory level up to the current working directory.<\/p>\n\n\n\n<p>$ cd -<\/p>\n\n\n\n<p>This command is used to navigate to the previous directory or simply go one directory back to the directory which the user visited.&nbsp;<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"7-clear\"><strong>7.clear<\/strong><\/h4>\n\n\n\n<p>$ clear<\/p>\n\n\n\n<p>This command will clear all the data present on the Linux terminal window.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"8-mv\"><strong>8. mv<\/strong><\/h4>\n\n\n\n<p>$ mv<\/p>\n\n\n\n<p>This command is used to change the name of a file\/directory or to move a particular file\/directory from one place to another.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"9-cp\"><strong>9. cp<\/strong><\/h4>\n\n\n\n<p>$ cp<\/p>\n\n\n\n<p>This is used to copy files\/directory from one place to another. The user can easily create multiple copies of a files\/directories using this command.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"10-cat\"><strong>10. cat<\/strong><\/h4>\n\n\n\n<p>$ cat<\/p>\n\n\n\n<p>Displays all the contents of a file on the output device.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"11-du\"><strong>11. du<\/strong><\/h4>\n\n\n\n<p>$ du<\/p>\n\n\n\n<p>\u201cdu\u201d stands for&nbsp; \u201cDisk Utility\u201d. This command displays the details about how much space is occupied by a file\/directory in the disk.<\/p>\n\n\n\n<p>$ du -sh<\/p>\n\n\n\n<p>(\u201c-s\u201d= Summary and \u201c-h\u201d= Human Readable). It shows the details of the space occupied by a file\/directory on disk in bytes, megabytes, gigabytes, etc.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"12-touch\"><strong>12. touch<\/strong><\/h4>\n\n\n\n<p>$ touch<\/p>\n\n\n\n<p>This command creates an empty file with the specified name in the current working directory.&nbsp; An empty file with size 0 bytes gets created and will&nbsp; not&nbsp; be changed&nbsp; until the user makes any changes to it.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"13-who\"><strong>13. who<\/strong><\/h4>\n\n\n\n<p>$ who<\/p>\n\n\n\n<p>It displays the number of users who are currently logged on Linux OS.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"14-echo\"><strong>14. echo<\/strong><\/h4>\n\n\n\n<p>$ echo<\/p>\n\n\n\n<p>displays text written after the word \u201cecho\u201d.&nbsp;<\/p>\n\n\n\n<p>Ex.- echo My House name is Sweet Dreams, this command output will be: \u201cMy House name is Sweet Dreams\u201d.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"15-date\"><strong>15. date<\/strong><\/h4>\n\n\n\n<p>$ date<\/p>\n\n\n\n<p>Displays the current date and time of your system. We easily know the current day and time on the Linux terminal using this command.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"16-gzip\"><strong>16 .gzip<\/strong><\/h4>\n\n\n\n<p>$ gzip filename<\/p>\n\n\n\n<p>This command compresses content of files, gives extension of .gz and needs to be uncompressed before use.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"17-touch\"><strong>17. touch<\/strong><\/h4>\n\n\n\n<p>$ touch filename<\/p>\n\n\n\n<p>It creates new empty files and also used to change date and time of recent access and modification.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"18-locate\"><strong>18. locate<\/strong><\/h4>\n\n\n\n<p>$ locate filename<\/p>\n\n\n\n<p>Used to search find files by name and it also searches very fast, runs in the background to trace the location of files. It also searches the file and stores them in a database.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"19-echo\"><strong>19. echo<\/strong><\/h4>\n\n\n\n<p>$ echo String<\/p>\n\n\n\n<p>This command writes arguments to the standard output or display line of text. This command is used in batch and scripts. This also plays an important role in building shell script.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"20-grep\"><strong>20. grep<\/strong><\/h4>\n\n\n\n<p>$ grep \u201cString\u201d filename<\/p>\n\n\n\n<p>This command searches the text or file for lines containing a match to the given strings\/words.&nbsp;<\/p>\n\n\n\n<p>$ grep \"String\" filename1 filename2<\/p>\n\n\n\n<p>This command&nbsp; searches the mentioned String in multiple files.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"21-clear\"><strong>21. clear<\/strong><\/h4>\n\n\n\n<p>$ clear<\/p>\n\n\n\n<p>This command clears the screen.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"22-logout\"><strong>22. logout<\/strong><\/h4>\n\n\n\n<p>$ logout<\/p>\n\n\n\n<p>This command is used to exit a login shell or to get out of a current session.&nbsp;<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"23-exit\"><strong>23. exit<\/strong><\/h4>\n\n\n\n<p>$ exit<\/p>\n\n\n\n<p>This command is to exit a shell, like log out. It also reminds us that some jobs are running in the background.&nbsp;<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"24-wc\"><strong>24. wc<\/strong><\/h4>\n\n\n\n<p>$ wc [options] filename<\/p>\n\n\n\n<p>This command is used to print the number of newlines, word, bytes in a file.&nbsp;<\/p>\n\n\n\n<p>$ wc -l filename<\/p>\n\n\n\n<p>This command is used to print the number of lines in a file.<\/p>\n\n\n\n<p>$ wc -w filename<\/p>\n\n\n\n<p>This command is used to print the number of words in a file.<\/p>\n\n\n\n<p>$ wc -c filename<\/p>\n\n\n\n<p>This command is used to display the count of bytes of a file.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"25-sort\"><strong>25. sort<\/strong><\/h4>\n\n\n\n<p>$ sort filename<\/p>\n\n\n\n<p>This command sorts the file in alphabetical order and is used for printing lines of input text files and concatenation of all files in sorted order.&nbsp;<\/p>\n\n\n\n<p>$ sort -u filename<\/p>\n\n\n\n<p>-u in sort command removes duplicate records in a file and only the first record is retained.<\/p>\n\n\n\n<p>$ sort -n file<\/p>\n\n\n\n<p>This command&nbsp; sorts a file numerically.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"26-kill\"><strong>26. kill<\/strong><\/h4>\n\n\n\n<p>$ kill<\/p>\n\n\n\n<p>It stops a process and kills or terminates a process without logging out or restarting the system.&nbsp;<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"27-ps\"><strong>27. ps<\/strong><\/h4>\n\n\n\n<p>$ ps<\/p>\n\n\n\n<p>It will display current running process in&nbsp;the system and also used for view process running on system. It provides information on current processes like CPU usage, user id, command name and memory usage.<\/p>\n\n\n\n<p>$ ps -ax<\/p>\n\n\n\n<p>It shows all current running processes.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"28-uptime\"><strong>28. uptime<\/strong><\/h4>\n\n\n\n<p>$ uptime<\/p>\n\n\n\n<p>This command shows time from which system has been running. It will show current time of system, No.of&nbsp; users that are currently active and system load average.&nbsp;<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"29-sleep\"><strong>29. sleep<\/strong><\/h4>\n\n\n\n<p>$ sleep number [suffix]<\/p>\n\n\n\n<p>These command delays or pauses for a specified amount of time. It actually causes the system with a given amount of time and also suspends the system for mentioned duration, then turns on or resumes.<\/p>\n\n\n\n<p>$ sleep (n)<\/p>\n\n\n\n<p>Sleep for (n) seconds.<\/p>\n\n\n\n<p>$ sleep (nm)<\/p>\n\n\n\n<p>Sleep for (n) minutes.<\/p>\n\n\n\n<p>$ sleep (nh)<\/p>\n\n\n\n<p>Sleeps for (n) hours.<\/p>\n\n\n\n<p>$ sleep (nd)<\/p>\n\n\n\n<p>Sleeps for (n) days.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"30-seq\"><strong>30. seq<\/strong><\/h4>\n\n\n\n<p>$ seq n<\/p>\n\n\n\n<p>Prints numbers starting from 1 to n and also prints the numbers from first to last with an increment. All numbers can be real, not just integers.<\/p>\n\n\n\n<p>$ seq n1 n2<\/p>\n\n\n\n<p>Prints number starting from n1 to n2.<\/p>\n\n\n\n<p>This brings us to the end of the Linux Tutorial. We hope that you found this helpful and were able to learn some valuable information from the same. If you wish to learn more such concepts, you can check out the <a href=\"https:\/\/www.mygreatlearning.com\/academy\">Free Online Courses available on Great Learning Academy. <\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction to Linux Let's get started with the Linux Tutorial! It is a free, open-source, and community-developed operating system. It was created as a hobby by Linus Torvalds in 1991. Linus, while at university, wanted to create an alternative, free, open-source version of the MINIX operating system that is based on the principles and design [&hellip;]<\/p>\n","protected":false},"author":41,"featured_media":27955,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_uag_custom_page_level_css":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[25860],"tags":[36888],"content_type":[],"class_list":["post-27903","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software","tag-operating-system"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.3 (Yoast SEO v27.3) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Linux Tutorial | Linux Tutorial for Beginners - Great Learning<\/title>\n<meta name=\"description\" content=\"Linux Tutorial: It is a free, open-source and community-developed operating system. It was created as a hobby by Linus Torvalds in 1991.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.mygreatlearning.com\/blog\/linux-tutorial\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Linux Tutorial | Everything you need to know about Linux\" \/>\n<meta property=\"og:description\" content=\"Linux Tutorial: It is a free, open-source and community-developed operating system. It was created as a hobby by Linus Torvalds in 1991.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.mygreatlearning.com\/blog\/linux-tutorial\/\" \/>\n<meta property=\"og:site_name\" content=\"Great Learning Blog: Free Resources what Matters to shape your Career!\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/GreatLearningOfficial\/\" \/>\n<meta property=\"article:published_time\" content=\"2021-04-01T02:33:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-30T11:43:39+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/03\/iStock-1140980831.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1254\" \/>\n\t<meta property=\"og:image:height\" content=\"837\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Great Learning Editorial Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/Great_Learning\" \/>\n<meta name=\"twitter:site\" content=\"@Great_Learning\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Great Learning Editorial Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"55 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/linux-tutorial\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/linux-tutorial\\\/\"},\"author\":{\"name\":\"Great Learning Editorial Team\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#\\\/schema\\\/person\\\/6f993d1be4c584a335951e836f2656ad\"},\"headline\":\"Linux Tutorial | Everything you need to know about Linux\",\"datePublished\":\"2021-04-01T02:33:00+00:00\",\"dateModified\":\"2024-04-30T11:43:39+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/linux-tutorial\\\/\"},\"wordCount\":12967,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/linux-tutorial\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/03\\\/iStock-1140980831.jpg\",\"keywords\":[\"operating system\"],\"articleSection\":[\"IT\\\/Software Development\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/linux-tutorial\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/linux-tutorial\\\/\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/linux-tutorial\\\/\",\"name\":\"Linux Tutorial | Linux Tutorial for Beginners - Great Learning\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/linux-tutorial\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/linux-tutorial\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/03\\\/iStock-1140980831.jpg\",\"datePublished\":\"2021-04-01T02:33:00+00:00\",\"dateModified\":\"2024-04-30T11:43:39+00:00\",\"description\":\"Linux Tutorial: It is a free, open-source and community-developed operating system. It was created as a hobby by Linus Torvalds in 1991.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/linux-tutorial\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/linux-tutorial\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/linux-tutorial\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/03\\\/iStock-1140980831.jpg\",\"contentUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/03\\\/iStock-1140980831.jpg\",\"width\":1254,\"height\":837,\"caption\":\"Linux Tutorial\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/linux-tutorial\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Blog\",\"item\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"IT\\\/Software Development\",\"item\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/software\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Linux Tutorial | Everything you need to know about Linux\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/\",\"name\":\"Great Learning Blog\",\"description\":\"Learn, Upskill &amp; Career Development Guide and Resources\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#organization\"},\"alternateName\":\"Great Learning\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#organization\",\"name\":\"Great Learning\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/GL-Logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/GL-Logo.jpg\",\"width\":900,\"height\":900,\"caption\":\"Great Learning\"},\"image\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/GreatLearningOfficial\\\/\",\"https:\\\/\\\/x.com\\\/Great_Learning\",\"https:\\\/\\\/www.instagram.com\\\/greatlearningofficial\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/school\\\/great-learning\\\/\",\"https:\\\/\\\/in.pinterest.com\\\/greatlearning12\\\/\",\"https:\\\/\\\/www.youtube.com\\\/user\\\/beaconelearning\\\/\"],\"description\":\"Great Learning is a leading global ed-tech company for professional training and higher education. It offers comprehensive, industry-relevant, hands-on learning programs across various business, technology, and interdisciplinary domains driving the digital economy. These programs are developed and offered in collaboration with the world's foremost academic institutions.\",\"email\":\"info@mygreatlearning.com\",\"legalName\":\"Great Learning Education Services Pvt. Ltd\",\"foundingDate\":\"2013-11-29\",\"numberOfEmployees\":{\"@type\":\"QuantitativeValue\",\"minValue\":\"1001\",\"maxValue\":\"5000\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#\\\/schema\\\/person\\\/6f993d1be4c584a335951e836f2656ad\",\"name\":\"Great Learning Editorial Team\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/02\\\/unnamed.webp\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/02\\\/unnamed.webp\",\"contentUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/02\\\/unnamed.webp\",\"caption\":\"Great Learning Editorial Team\"},\"description\":\"The Great Learning Editorial Staff includes a dynamic team of subject matter experts, instructors, and education professionals who combine their deep industry knowledge with innovative teaching methods. Their mission is to provide learners with the skills and insights needed to excel in their careers, whether through upskilling, reskilling, or transitioning into new fields.\",\"sameAs\":[\"https:\\\/\\\/www.mygreatlearning.com\\\/\",\"https:\\\/\\\/in.linkedin.com\\\/school\\\/great-learning\\\/\",\"https:\\\/\\\/x.com\\\/https:\\\/\\\/twitter.com\\\/Great_Learning\",\"https:\\\/\\\/www.youtube.com\\\/channel\\\/UCObs0kLIrDjX2LLSybqNaEA\"],\"award\":[\"Best EdTech Company of the Year 2024\",\"Education Economictimes Outstanding Education\\\/Edtech Solution Provider of the Year 2024\",\"Leading E-learning Platform 2024\"],\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/author\\\/greatlearning\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Linux Tutorial | Linux Tutorial for Beginners - Great Learning","description":"Linux Tutorial: It is a free, open-source and community-developed operating system. It was created as a hobby by Linus Torvalds in 1991.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.mygreatlearning.com\/blog\/linux-tutorial\/","og_locale":"en_US","og_type":"article","og_title":"Linux Tutorial | Everything you need to know about Linux","og_description":"Linux Tutorial: It is a free, open-source and community-developed operating system. It was created as a hobby by Linus Torvalds in 1991.","og_url":"https:\/\/www.mygreatlearning.com\/blog\/linux-tutorial\/","og_site_name":"Great Learning Blog: Free Resources what Matters to shape your Career!","article_publisher":"https:\/\/www.facebook.com\/GreatLearningOfficial\/","article_published_time":"2021-04-01T02:33:00+00:00","article_modified_time":"2024-04-30T11:43:39+00:00","og_image":[{"width":1254,"height":837,"url":"http:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/03\/iStock-1140980831.jpg","type":"image\/jpeg"}],"author":"Great Learning Editorial Team","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/Great_Learning","twitter_site":"@Great_Learning","twitter_misc":{"Written by":"Great Learning Editorial Team","Est. reading time":"55 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.mygreatlearning.com\/blog\/linux-tutorial\/#article","isPartOf":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/linux-tutorial\/"},"author":{"name":"Great Learning Editorial Team","@id":"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/person\/6f993d1be4c584a335951e836f2656ad"},"headline":"Linux Tutorial | Everything you need to know about Linux","datePublished":"2021-04-01T02:33:00+00:00","dateModified":"2024-04-30T11:43:39+00:00","mainEntityOfPage":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/linux-tutorial\/"},"wordCount":12967,"commentCount":0,"publisher":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/linux-tutorial\/#primaryimage"},"thumbnailUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/03\/iStock-1140980831.jpg","keywords":["operating system"],"articleSection":["IT\/Software Development"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.mygreatlearning.com\/blog\/linux-tutorial\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.mygreatlearning.com\/blog\/linux-tutorial\/","url":"https:\/\/www.mygreatlearning.com\/blog\/linux-tutorial\/","name":"Linux Tutorial | Linux Tutorial for Beginners - Great Learning","isPartOf":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/linux-tutorial\/#primaryimage"},"image":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/linux-tutorial\/#primaryimage"},"thumbnailUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/03\/iStock-1140980831.jpg","datePublished":"2021-04-01T02:33:00+00:00","dateModified":"2024-04-30T11:43:39+00:00","description":"Linux Tutorial: It is a free, open-source and community-developed operating system. It was created as a hobby by Linus Torvalds in 1991.","breadcrumb":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/linux-tutorial\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.mygreatlearning.com\/blog\/linux-tutorial\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.mygreatlearning.com\/blog\/linux-tutorial\/#primaryimage","url":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/03\/iStock-1140980831.jpg","contentUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/03\/iStock-1140980831.jpg","width":1254,"height":837,"caption":"Linux Tutorial"},{"@type":"BreadcrumbList","@id":"https:\/\/www.mygreatlearning.com\/blog\/linux-tutorial\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog","item":"https:\/\/www.mygreatlearning.com\/blog\/"},{"@type":"ListItem","position":2,"name":"IT\/Software Development","item":"https:\/\/www.mygreatlearning.com\/blog\/software\/"},{"@type":"ListItem","position":3,"name":"Linux Tutorial | Everything you need to know about Linux"}]},{"@type":"WebSite","@id":"https:\/\/www.mygreatlearning.com\/blog\/#website","url":"https:\/\/www.mygreatlearning.com\/blog\/","name":"Great Learning Blog","description":"Learn, Upskill &amp; Career Development Guide and Resources","publisher":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/#organization"},"alternateName":"Great Learning","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.mygreatlearning.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.mygreatlearning.com\/blog\/#organization","name":"Great Learning","url":"https:\/\/www.mygreatlearning.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/06\/GL-Logo.jpg","contentUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/06\/GL-Logo.jpg","width":900,"height":900,"caption":"Great Learning"},"image":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/GreatLearningOfficial\/","https:\/\/x.com\/Great_Learning","https:\/\/www.instagram.com\/greatlearningofficial\/","https:\/\/www.linkedin.com\/school\/great-learning\/","https:\/\/in.pinterest.com\/greatlearning12\/","https:\/\/www.youtube.com\/user\/beaconelearning\/"],"description":"Great Learning is a leading global ed-tech company for professional training and higher education. It offers comprehensive, industry-relevant, hands-on learning programs across various business, technology, and interdisciplinary domains driving the digital economy. These programs are developed and offered in collaboration with the world's foremost academic institutions.","email":"info@mygreatlearning.com","legalName":"Great Learning Education Services Pvt. Ltd","foundingDate":"2013-11-29","numberOfEmployees":{"@type":"QuantitativeValue","minValue":"1001","maxValue":"5000"}},{"@type":"Person","@id":"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/person\/6f993d1be4c584a335951e836f2656ad","name":"Great Learning Editorial Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/02\/unnamed.webp","url":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/02\/unnamed.webp","contentUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/02\/unnamed.webp","caption":"Great Learning Editorial Team"},"description":"The Great Learning Editorial Staff includes a dynamic team of subject matter experts, instructors, and education professionals who combine their deep industry knowledge with innovative teaching methods. Their mission is to provide learners with the skills and insights needed to excel in their careers, whether through upskilling, reskilling, or transitioning into new fields.","sameAs":["https:\/\/www.mygreatlearning.com\/","https:\/\/in.linkedin.com\/school\/great-learning\/","https:\/\/x.com\/https:\/\/twitter.com\/Great_Learning","https:\/\/www.youtube.com\/channel\/UCObs0kLIrDjX2LLSybqNaEA"],"award":["Best EdTech Company of the Year 2024","Education Economictimes Outstanding Education\/Edtech Solution Provider of the Year 2024","Leading E-learning Platform 2024"],"url":"https:\/\/www.mygreatlearning.com\/blog\/author\/greatlearning\/"}]}},"uagb_featured_image_src":{"full":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/03\/iStock-1140980831.jpg",1254,837,false],"thumbnail":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/03\/iStock-1140980831-150x150.jpg",150,150,true],"medium":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/03\/iStock-1140980831-300x200.jpg",300,200,true],"medium_large":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/03\/iStock-1140980831-768x513.jpg",768,513,true],"large":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/03\/iStock-1140980831-1024x683.jpg",1024,683,true],"1536x1536":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/03\/iStock-1140980831.jpg",1254,837,false],"2048x2048":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/03\/iStock-1140980831.jpg",1254,837,false],"web-stories-poster-portrait":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/03\/iStock-1140980831-640x837.jpg",640,837,true],"web-stories-publisher-logo":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/03\/iStock-1140980831-96x96.jpg",96,96,true],"web-stories-thumbnail":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/03\/iStock-1140980831-150x100.jpg",150,100,true]},"uagb_author_info":{"display_name":"Great Learning Editorial Team","author_link":"https:\/\/www.mygreatlearning.com\/blog\/author\/greatlearning\/"},"uagb_comment_info":0,"uagb_excerpt":"Introduction to Linux Let's get started with the Linux Tutorial! It is a free, open-source, and community-developed operating system. It was created as a hobby by Linus Torvalds in 1991. Linus, while at university, wanted to create an alternative, free, open-source version of the MINIX operating system that is based on the principles and design&hellip;","_links":{"self":[{"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/posts\/27903","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/users\/41"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/comments?post=27903"}],"version-history":[{"count":56,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/posts\/27903\/revisions"}],"predecessor-version":[{"id":104637,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/posts\/27903\/revisions\/104637"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/media\/27955"}],"wp:attachment":[{"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/media?parent=27903"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/categories?post=27903"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/tags?post=27903"},{"taxonomy":"content_type","embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/content_type?post=27903"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}