Linux Basics

Tejashree Salvi
4 min readApr 23, 2023

--

Day: 2/90

In this article, we are going to explore Linux Basics

  1. Introduction to Linux
  2. Basic Architecture of Linux
  3. Basic Commands with Examples

Introduction to Linux

Linux is a computer operating system that was developed by Linus Torvalds in the early 1990s. It’s free and open-source, which means that anyone can use, modify, and distribute it without any licensing fees.

Linux is known for its command-line interface, which allows users to interact with the system using text commands. It also offers a wide range of software development tools, such as Git, Docker, and Kubernetes, which are commonly used in DevOps workflows.

Basic Architecture of Linux

For example, you want to use a web browser like Firefox on a Linux system.

  1. Hardware: The computer hardware includes components such as the CPU, RAM, and hard drive that are used to run the operating system and applications.
  2. Kernel: The Linux kernel is responsible for managing system resources such as the CPU, memory, and input/output devices. When you start Firefox, the kernel interacts with the hardware to allocate system resources to the program and ensure that it runs smoothly.
  3. Shell: The shell is the interface that allows you to interact with the operating system. You might use the command line to start Firefox, for example, by typing “firefox” at the prompt. The shell interprets your command and communicates with the kernel to launch the program.
  4. Applications: It provides a user-friendly interface for browsing the web and uses system resources provided by the kernel to function. Firefox is an example of an application that runs on top of the operating system.

Linux File System Hierarchy

In Linux everything is represented as a File, these files are stored inside a directory and have a tree-like structure. This is known as File System Hierarchy.

It uses a single-root inverted tree-like structure.

Linux File System

By default, Linux assigns different colors to different types of files and directories.

For example, directories are usually displayed in blue, regular files in black, executables in green, symbolic links in cyan, and so on.

Basic Linux Commands

Pre-requisites: Install Linux Operating System/ Create an EC2 instance using the Ubuntu operating system on AWS.

ls : List files and directories in the current working directory.

ls -l : Lists the contents of the current directory in a long format, including file permissions, owner, group, size, and modification date.

ls -a : Lists all files and directories, including hidden files, in the current directory. Hidden files start with a dot (.)

ls -lh: list the content in a long format and file sizes in a human-readable format.

ls -R : list the content of the current directory and its sub-directories recursively.

pwd : This command stands for "print working directory". It prints the current working directory in which the user currently is.

touch : This command helps to create a new file.

cd - change the current working directory to the specified directory.

  1. cd ~ : used to navigate to the home directory.
  2. cd /: take you to the root directory
  3. cd .. : take you one directory up from the current directory
  4. cd <path/to/directory> : will take you to the specified directory path.

mkdir : creates a new directory with the specified name.

  1. mkdir dev qa prod : creates multiple directories at once.
  2. mkdir logfolder{1..10} : creates a range of directories with sequential numbers from 1 to 10.

mkdir -p parent/child/grand_child : creates nested directories at once.

There are numerous commands available in Linux, which can be explored in detail in a separate article.

Github link for Day 2 #90daysofdevops with Shubham Londhe

Thanks for taking the time to read the article, I appreciate it! Add some claps if you liked it.

Follow for more such content.

--

--

Tejashree Salvi
Tejashree Salvi

Written by Tejashree Salvi

Learning DevOps, Blogging, Programming

Responses (2)