Linux | Part 1

Linux | Part 1

In this blog I am going to discuss briefly about Linux OS, its architecture and basic commands used to interact with Linux OS.

·

3 min read

Linux

Linux is an Open-Source OS based on Unix and developed in C. Linux is one of the best and most widely operating systems that support all kinds of programming languages.

The features of Linux

  • It is open source.

  • It has a lightweight infrastructure.

  • It reduces monitoring costs.

  • There is a huge base of developers with community support.

  • It is reliable and portable.

  • It is secure and less vulnerable compared to other operating systems.

  • It has a shell/command line interface.

  • Linux supports multi-user and multi-programming.

The architecture of Linux

  1. Hardware: The Hardware of the OS constitutes RAM, CPU, HDD, and other physical components required to run the OS.

  2. Kernel: It is the core component of the OS. It is involved with resource allocation, security management, process management, device management etc.

  3. Shell: Shell acts as the interface to the kernel. It takes the user commands from the application and executes them in the kernel function.

  4. Application: It handles the main programs of the architecture. This is the layer where users interact with OS.

Basic Commands of Linux OS

Linux users use CLI (Command Line Interface) to communicate with the OS:

In this blog, we are going to discuss basic commands like listing commands and directory commands used in Linux.

Listing Commands

Listing commands are used for listing files and/or directories in Linux OS.

Syntax:

ls <flag>

Some of the commonly used listing commands with flags are:

ls

Lists files and directories in Linux.

ls -a

Lists all hidden contents in a specified directory.

ls -l

Lists all contents along with its owner settings, permissions, timestamp along with format.

ls -i

List the files and directories with index numbers in order.

ls -s

Sorts and lists all contents by size.

ls *.<file-format>

Using “*” lists only contents in the file format.

Directory Commands

These commands are used for working in between directories.

pwd

This command gives the output as the current working directory of the terminal.

cd /pathname/

Used to change the current directory of the user.

cd ~

Changes directory to home directory.

cd /

Changes the directory to the root directory.

cd ..

Changes the directory to its parent directory.

mkdir foldername

Creates a new directory.

mkdir .foldername

Creates a hidden directory.

mkdir Folder1 Folder2 Folder3

Creates multiple directories in the current working directory.

mkdir -p Folder1/Folder2/Foolder2

This command is used in the creation of nested directories.

These are the basic commands of Linux used for listing and directory commands. In the next blog, we can discuss other basic commands and play a little more with the Linux CLI.

For Reference: I have used an AWS EC2 instance for the Linux OS. There are other service providers like Azure and GCP that provision free Compute resources that can be utilized.

Did you find this article valuable?

Support Sneha K S by becoming a sponsor. Any amount is appreciated!