🚀Day 2: Introduction to Linux | Linux Basics Commands🚀

📍What is Linux?

Linux is an open-source operating system that serves as the foundation for many different distributions (distros). It was initially created by Linus Torvalds in 1991 and has since become one of the most popular and influential operating systems worldwide.

Linux is known for its stability, security, and flexibility. It is based on the Unix operating system and shares many of its principles and design elements.

Linux is highly customizable, allowing users to tailor the operating system to their specific needs. It is widely used in various domains, including servers, desktop computers, embedded systems, and even mobile devices (e.g., Android is built on a Linux kernel).


🗂 File system hierarchy in Linux:

  1. / (Root): The root directory is the top-level directory in the file system hierarchy. It is the parent directory for all other directories and files.

  2. /bin (Binary): Essential executable files and commands are stored in this directory. It contains fundamental system utilities needed for booting, maintenance, and basic system functionality.

  3. /boot: This directory contains the files required for the system's boot process, such as the bootloader configuration, kernel files, and initial RAM disk.

  4. /dev (Devices): Device files representing hardware devices are stored in this directory. It allows access to various devices, including disks, terminals, printers, and input/output devices.

  5. /etc (Configuration): System-wide configuration files are placed in this directory. It contains configuration files for various system services, network settings, user management, and more.

  6. /home: This directory contains user home directories. Each user has a subdirectory within /home, where they can store personal files and settings.

  7. /lib (Library): Shared libraries required by the system and applications are stored here. These libraries provide reusable code that programs can use to perform various tasks.

  8. /mnt (Mount): This directory is used as a temporary mount point for manually mounting filesystems or network shares.

  9. /opt (Optional): Optional software packages or applications can be installed in this directory. It provides a place to install additional software that is not part of the core system.

  10. /proc: This virtual filesystem provides information about running processes, system configuration, and hardware resources. It is used by various system utilities to gather and display system information.

  11. /sbin (System Binaries): System administration binaries and executables are stored here. It contains essential system administration tools and commands used for system maintenance and configuration.

  12. /tmp (Temporary): Temporary files created by processes and applications are stored in this directory. The files in /tmp are typically cleared upon system reboot.

  13. /usr (Unix System Resources): This directory contains user-specific programs, libraries, documentation, and shared resources that are not essential for system booting or maintenance.

  14. /var (Variable): Variable data, including log files, spool files, temporary files, and other data that changes frequently, is stored in this directory.


⚙️Linux Architecture

The architecture of a Linux System consists of the following layers

  • 💻Hardware layer💻: consists of all peripheral devices (RAM/ HDD/ CPU)

  • ⚙️Kernel⚙️: It is the core of the Operating System and interacts directly with hardware, It controls computer hardware

  • 🐚shell🐚: The shell is a command-line interface that allows users to interact with the operating system. An interface to kernel, Convert user's pieces of information to kernel standard format

  • 📱Application📱: Linux supports a wide range of applications and software. These include web browsers, office suites, media players, development tools, servers, databases, and more.

This is a high-level overview of the Linux architecture, showcasing the key components and their interactions. Linux's modular design and open nature allow for flexibility, customization, and a vibrant community-driven development model.


👨🏻‍💻Day 2 Task: Basics Linux command

  • Check your present working directory.

    pwd - Display current working directory name

  • List all the files or directories including hidden files.

    ls - list directory contents

ls display the names of files and directories in a simple format, but you can add additional options to modify its behavior. For example:

  • ls -a shows all files and directories, including hidden ones that start with a dot (e.g., .config).

  • Create a nested directory A/B/C/D/E

    To create a nested directory structure in Linux, you can use the -p option with the mkdir command. This option ensures that parent directories are created if they don't already exist.


🔖Basic Linux Command

Command

Description

man

The man utility finds and displays online manual documentation pages.

date

Display the current system date and time

cd ..

Change the directory to one level up

cat filename

Display the content of the file

tail filename

Display the last 10 lines of a file

head filename

Display the first 10 lines of a file

rm -rf dirname

Remove a directory

history

Print a history list of all commands

clear

Clear the terminal

useradd username

Add a new user account

echo

write arguments to the standard output

sudo

sudo allows a permitted user to execute a command as the superuser

apt-get update

Update the package index

apt-get upgrade packagename

Upgrade a package.

whoami

Display current login user name

cp

It is used to copy and paste

touch

It is used for creating a file

ls

List files and directories of the current directory

mkdir

Create a new directory.

pwd

Display the current working directory name


🌟 Conclusion:

Congratulations! 🎉 Linux is a powerful, open-source operating system that has gained widespread popularity and is used in a wide range of applications and environments. It offers numerous benefits and features. We hope this blog has given you a taste of what is Linux and some commands. Linux is a vast and versatile operating system, with endless possibilities waiting for you to explore! 🚀 Embrace the Linux power and have fun with your Linux journey! 🐧💪

🔍 Did you find this blog helpful? Let us know in the comments below! 👇 And if you have any questions or need further assistance, we're here to help! 🤗

Happy Linux-ing! 💻✨