Day-2 : LINUX FUNDAMENTALS

Vedvilas KVedvilas K
5 min read

Introduction:

Welcome to Day 2 of the 90-Day DevOps Challenge! Today, we will dive into the fundamental concepts of Linux, an open-source operating system that plays a crucial role in the world of DevOps. Understanding Linux is essential for any DevOps practitioner, as it forms the foundation of many server environments and provides a powerful platform for running applications and managing resources. In this blog post, we will explore the key components of Linux, its architecture, and some basic commands to get you started on your Linux journey

What is Linux?

Linux is an open-source operating system that serves as the foundation for numerous computing systems. Unlike proprietary operating systems, Linux allows users to access and modify its source code, fostering a collaborative and customizable environment. Linux interacts directly with a system's hardware, managing resources such as the CPU, memory, and storage. It provides a robust and secure platform for running applications and servers.

Components of the Linux File System:

a. Kernel: The Linux kernel is the core part of the operating system. It interacts directly with the hardware, providing an abstraction layer that hides low-level hardware details from system and application programs. It handles key activities and manages resources efficiently.

b. System Libraries: Linux offers a set of system libraries that implement most of the functionalities of the operating system. These libraries provide functions and programs that allow application programs and system utilities to access the kernel's features without requiring direct access rights to the kernel modules.

c. System Utility Programs: System utility programs in Linux perform specialized and individual tasks. These programs help manage the system, configure settings, perform administrative functions, and automate various operations.

Architecture of Linux:

A Linux system consists of several layers:

a. Kernel: The kernel is the heart of the Linux operating system. It handles critical tasks, manages hardware resources, and provides an interface for system processes and applications.

b. System Libraries: These libraries contain pre-compiled functions and code that allow applications to interact with the kernel and access system resources. They provide an abstraction layer, simplifying the development process for software developers.

c. System Utility Programs: System utility programs offer a range of functionalities to manage and configure the system. Examples include package managers, network configuration tools, and system monitoring utilities.

d. Hardware Layer: This layer comprises the physical components of the system, including the CPU, hard disk drives (HDD), RAM, and other peripheral devices.

e. Shell: The shell acts as an interface between the user and the kernel. It can be either a command-line shell or a graphical shell, enabling users to interact with the system and execute commands.

Basic Linux Commands:

To get started with Linux, here are some essential commands:

a. ls: Lists files and directories in the current location : Command: ls

b. cd: Changes the current directory : Command: cd directory_name

c. mkdir: Creates a new directory : Command: mkdir directory_name

d. rm: Removes a file : Command: rmdir directory_name

e. cp: Copies a file : Command : cp source_file destination path

f. mv: Moves or renames a file : Command : mv source_file destinamtion

g. cat: Displays the contents of a file : Command : cat file_name

h. clear: Clears the terminal screen : Command : clear

i. history: Shows a list of previously executed commands : Command : history

Tasks**:-**

We will embark on a journey to explore the Linux file system and learn some essential commands that will help you navigate and manage directories and files. Understanding how to effectively interact with the file system is fundamental to working with Linux. So, let's dive in and discover the power of these commands.

Present Working Directory (pwd)

The Present Working Directory command (pwd) allows you to quickly check your current location in the file system. It provides the absolute path of the directory you are currently working in.

Command: pwd: /home/user
Output :

Long List (ls -a)

The Long List command (ls) with the option -a is a versatile tool for listing directories and files, including hidden ones. It provides detailed information about each item, such as permissions, ownership, size, and last modification date.

Command -1: ls: (Displays the list of directories and files in the current directory)

Command -2: ls -a : (Displays the list of directories and files, including hidden ones)

Output:

Create a Nested Parent Directory

Creating nested directories can be accomplished easily using the mkdir command with the -p flag. This allows you to create multiple directories simultaneously, even if the parent directories don't exist.

Command: mkdir -p test1/test2/test3 Output: (Creates the nested directories test1/test2/test3)
Output :

Conclusion:

Congratulations! You've learned some essential commands to navigate and manage directories and files in the Linux file system. The pwd command helps you determine your current location, while the ls command with the -a option enables you to list directories and files, including hidden ones. Additionally, you now know how to create nested directories efficiently using the mkdir command with the -p flag.

Continue exploring the Linux file system, and remember to practice these commands to become more proficient. Stay tuned for more exciting blogs, where we will delve deeper into Linux concepts. Feel free to connect with me on LinkedIn for further updates and informative articles. Follow this link:[https://www.linkedin.com/in/vedvilas-kulkarni-6417351a2/]

Thank you for reading, and happy Linux exploring!

2
Subscribe to my newsletter

Read articles from Vedvilas K directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Vedvilas K
Vedvilas K