What is Linux?

Photo by Rod Long on Unsplash

What is Linux?

Hello! Hope you’re doing well. In this post we’ll talk about Linux. Linux is a free, opensource software that is highly customizable and ubiquitous in the computing world. Large parts of the internet as we know it runs on Linux based operating systems (OS). So, knowing Linux and working with Linux command line will take us a long way in the software industry and others as well.

Have you ever wondered why there is no “Linux OS” out there? I’m sure you heard of MacOS, Windows and even Linux “distros” but never Linux OS. Let's find out in this blog post.

Topics covered in this post:

  1. Types of software development and distribution
  2. What is Linux?
  3. What is a Linux “distro”?
  4. What is a Linux command line?
  5. Linux commands

1. Types of software development and distribution

Let's understand the following terms to get a better idea of how software is developed:

  1. Opensource- The source code in the software is available to view and modify. A community of developers contributes to build and maintain it.
  2. Free- Software that is free to use for the individual. One may not be able to view the source code and in some cases the code cannot be modified or distributed
  3. Closed source- The source code is not visible and the end user cannot modify anything in the product or even redistribute it. Users have to pay to obtain it

2. What is Linux?

Linux is a free and opensource, UNIX-like operating system (actually a kernel) developed by Linus Torvalds as a “free operating system” [in 1991] (cs.cmu.edu/~awb/linux.history.html). It was based on (not a copy) Unix operating system, which was developed by AT&T (Bell Labs) as a proprietary OS (some versions).

Linux on the other hand was developed as a free and opensource alternative for Unix. We can get the publicly available source code for Linux, modify it and even redistribute it without any cost involved. Also, developers across the globe participate in contributing to Linux development.

Opensource nature of Linux allows us to modify it for all kinds of purposes ranging from microcontrollers to a massive supercomputer and even in space vehicles there are on moon and mars.

Linux as you probably might think, is not a full-fledged OS but it is a kernel. A kernel is a part of the OS which talks to the hardware components like CPU, RAM etc., and other components in the OS as shown below:

Linux Architecture Linux Architecture. Source: interviewbit.com/linux-interview-questions

3. What is a Linux “distro”?

When the first version of the Linux kernel was developed, it was distributed with the with a set of GNU utilities and tools for setting up a file system, the Graphical User Interface (GUI) and apps like terminal. This is where it gets the name “Linux distribution” (Linux distro).

Untitled 1.png Linux distribution. Source: How SUSE builds its Enterprise Linux distribution – PART 2 | SUSE Communities

This is still the case to this day and there hundreds of Linux distributions are available and every distro has Linux kernel and GNU components. One can download for free and even customize them to their heart’s content. There are distros that are derived from other distros. Needless to say, this is a huge hobby among enthusiasts to try out various distros and tinker with them.

4. What is a Linux command line?

A Linux command line is a text interface which allows us to interact with the computer using commands. It is often referred to as shell, terminal, console or various other names and definitions are mentioned below:

  1. Terminal: A text-based environment where you input the commands and see the output. A terminal will pass the input commands to shell for execution and display the output from it.

    Examples: Windows Terminal

  2. Shell: A shell is the program that the terminal sends user input to. The shell generates output and passes it back to the terminal for display

    Examples:

    • bash, fish, zsh, ksh, sh, tsch
    • PowerShell, pwsh

      The popular shell among the Linux distributions is “Bourne Again SHell” or bash.

  3. Console: A console is a physical device that has a terminal with a screen and keyboard. In the software world a terminal and a console are referred interchangeably

Now you might ask, how is this useful? Well, in a normal desktop environment you will get all the GUI components installed. Which would look like in the below picture

Untitled 2.png Ubuntu GUI

This is great for personal use and everything in the GUI seems to be laid out perfectly. But when it comes to servers, where Linux is a primary choice; there will be no GUI and all the work should be done through the terminal.

Untitled 3.png Ubuntu command line

When you login to a server or open terminal app in your Linux distro, you’ll see the above window. What does the text me@linuxbox:~$ mean?

  • me: username which you logged in
  • linuxbox: name of the machine or server
  • ~: home directory(folder) for the user. At any point one terminal session will be in one single directory. Likewise, multiple terminals can point to different directories
  • $: represents that you are a normal user. In a few shells, the admin/root user will see # instead of the $ sign. # also represents elevated privileges to the system.

You can enter any command after this window appears and hit Return key to display the output. We will discuss the user types, permissions and other topics in future posts.

I’m using WSL with Ubuntu going further and it looks like the below picture

Untitled 4.png Ubuntu on Windows Terminal with WSL2

/mnt/c/Users/manik is the home directory for the user.

5. Linux commands

Commands are reserved keywords that signify an action in the system. Here are a few example commands that we can try out in a Linux command line.

  • date- displays current date
  • cal- displays calendar with only current month and current date is highlighted
  • ls- lists all the directories and files in the current folder
  • pwd- present working directory
  • clear- clears(hides) all the contents on the terminal window

Untitled 5.png

Meanwhile if you type some random gibberish into the command line, it will throw error saying command not found. We can use the arrow keys to go through the command history (up arrow key) and also navigate within the command (left and right arrow keys)

Untitled 6.png

We can perform almost any action within the operating system using the commands. We will further explore all the important commands in future blog posts

References:

  1. Linux Command Line Books by William Shotts
  2. The Linux command line for beginners | Ubuntu
  3. What's the difference between a console, a terminal, and a shell? - Scott Hanselman's Blog
  4. Difference between Terminal, Console, Shell, and Command Line - GeeksforGeeks
  5. What is the difference between Terminal, Console, Shell, and Command Line? - Ask Ubuntu
  6. LinuxCommand.org: Learn The Linux Command Line. Write Shell Scripts.
  7. How SUSE builds its Enterprise Linux distribution – PART 2 | SUSE Communities

Did you find this article valuable?

Support mani nekkalapudi by becoming a sponsor. Any amount is appreciated!