Skip to main content

Command Palette

Search for a command to run...

Day 2: Understanding Linux: Core Concepts for Beginners

Updated
5 min read
Day 2: Understanding Linux: Core Concepts for Beginners
R

Hi, I’m Rakshita. A Cloud, DevOps, AI, and Python enthusiast passionate about learning and simplifying technology for others. I love exploring how modern tools and automation can make systems smarter and more efficient. Here, I write about: ☁️ Cloud & DevOps practices 🤖 AI in the world of automation 🐍 Python for real-world problem-solving 💡 Growth, consistency, and the learner’s mindset My goal is to bridge the gap between learning and doing, and help others grow confidently in the evolving tech landscape.

What is Linux?

Just like Windows, iOS, and Mac OS, Linux is an operating system. In fact, one of the most popular platforms on the planet. An operating system is software that manages all of the hardware resources associated with your desktop or laptop. To put it simply, an operating system manages the communication between your software and your hardware. Without the operating system (OS), the software wouldn’t function.

A Brief history of Linux

Linux was created in 1991 by Linus Torvalds, a student at the University of Helsinki in Finland. Linus wanted to create a free and open-source alternative to the MINIX operating system, which was primarily used for educational purposes. He started with the kernel, which is the core part of the OS that controls everything in the system.

Torvalds released Linux under the GNU General Public License (GPL), which allowed anyone to freely use, modify, and distribute it. This was a game-changer and led to a community of developers from all around the world contributing to its development.

Why use Linux?

  1. Open Source

  2. Security

  3. Permormance

  4. Customization

  5. Community Support

The Linux Architecture

Linux is an open-source UNIX-based operating system. The main component of the Linux operating system is Linux kernel. It is developed to provide low-cost or free operating system service to personal system users.

Components of Linux:

The architecture of linux can be divided into several key components:

  1. Application

  2. Shell

  3. Kernel

  4. Hardware

  1. Application: Applications are programs that run on top of the operating system to perform specific tasks. Examples include web browsers, text editors, and media players.
  1. Shell: Shell is the interface that interacts with humans and processes the commands that are given for the execution. One can call it an interpreter because it takes the command from the keyboard and makes it understandable to the kernel. The shell starts when one starts the terminal.

  2. Kernel: The kernel is the core part of the Linux operating system. It directly interacts with the hardware and provides low-level services to the rest of the system. It manages system resources and provides services to applications and processes running on the system.

  3. Hardware: The lowest level of the Linux architecture is the hardware layer. This layer comprises the physical components of a computer, such as the hard drive, RAM, motherboard, CPU, network interfaces, and peripherals. These components are the tangible pieces of your system on which the rest of the architecture is built.

Linux File System Hierarchy

The Linux file system hierarchy is a directory structure that organizes files and directories in a tree-like format. At the top of this hierarchy is the root directory, denoted by a forward slash (/). All other files and directories branch off from this root directory.

Let's dive into the key directories you'll find in a typical Linux system.

/ - Root Directory

The top-level directory from which all other directories branch off.

/bin - Essential User Binaries

Contains essential command binaries like ls, cp, and rm.

/boot - Boot Loader Files

Holds files needed for the boot process, including the kernel and boot loader configuration.

/dev - Device Files

Contains special files representing hardware devices.

/etc - Configuration Files

Stores system-wide configuration files and scripts.

/home - User Home Directories

Holds personal directories for users, e.g., /home/john.

/lib - Essential Shared Libraries

Contains libraries needed by binaries in /bin and /sbin.

/media - Removable Media

Used as a mount point for USB drives, CD-ROMs, and other removable media.

/mnt - Temporary Mount Points

For temporarily mounting filesystems during maintenance.

/opt - Optional Software

For installing additional software packages.

/proc - Process Information

A virtual filesystem with information about system processes and hardware.

/root - Root User Home Directory

Home directory for the root user.

/sbin - System Binaries

Contains system administration binaries used by the root user.

/srv - Service Data

Holds data for services provided by the system, such as web server files.

/tmp - Temporary Files

Stores temporary files created by applications, typically deleted on reboot.

/usr - User Utilities and Applications

Contains user utilities and applications, divided into subdirectories like /usr/bin and /usr/lib.

/var - Variable Data

Holds variable data like logs, mail spools, and temporary files.

Basic Linux Commands

⭐ Listing Commands

The ls (listing) command is used to list the contents of files and directories. Here are some useful options:

  1. ls -l

List files and directories in long format with extra information (permissions, owner, size, etc.).

ls -l
  1. ls -a

List all files, including hidden files (those starting with a dot).

ls -a
  1. ls *.sh

List all files with the .sh extension in the current directory.

ls *.sh
  1. ls -i

List files and directories along with their index numbers (inodes).

ls -i
  1. ls -d */

List only directories in the current directory.

ls -d */

⭐ Navigating Directories

Here are some essential commands for navigating through directories:

  1. pwd

Print the present working directory.

pwd
  1. cd path_to_directory

Change to the specified directory.

cd /home/user/documents
  1. cd ~ or cd

Change to the home directory.

cd ~
  1. cd -

Go back to the last working directory.

cd -
  1. cd ..

Move up one directory level.

cd ..
  1. cd ../..

Move up two directory levels.

cd ../..

7. mkdir directoryName

Create a new directory with the specified name.

mkdir <dir_name>

Conclusion

Linux is a powerful, open-source operating system known for its security, performance, and customization. Created by Linus Torvalds in 1991, Linux has grown through community collaboration.

Understanding Linux's architecture—from applications and shell to the kernel and hardware—helps in appreciating its efficiency. The organized file system hierarchy ensures smooth operation, with each directory serving a clear purpose.

Basic commands like 'ls' for listing files and navigation commands like 'cd' are essential for using Linux effectively. Whether you're a beginner or an advanced user, Linux offers flexibility and power for all your computing needs.

Happy exploring🚀

More from this blog

L

Learning Made Simple - RealTimeHandson

25 posts