Day 02: Linux- A Compact Overview

Day 02: Linux- A Compact Overview

LINUX

Linux is a free open-source, Unix-like operating system known for its stability, security, and versatility. It's at the heart of various Linux distributions used in servers, desktops, and embedded systems. It is developed by Linus Torvalds.

Features of Linux

  • Open Source: Linux is open-source software, with freely accessible source code.

  • Multi-User Support: It allows multiple users to work on the same system simultaneously.

  • Multi-Tasking: Linux handles multiple processes and tasks concurrently.

  • Stability: Linux is highly stable, with fewer system crashes.

  • Security: It features robust security controls and is less vulnerable to malware.

  • Scalability: Linux runs on a wide range of hardware, from small embedded devices to supercomputers.

  • Customization: Users can tailor Linux distributions to their specific needs.

  • Large Software Ecosystem: A vast repository of open-source software is available.

  • Command-Line Interface: Linux offers a powerful command-line interface.

  • Compatibility: It can run various file formats and software.

  • Fast Updates: Regular updates and security patches are released.

Some Flavors of LINUX

RHEL

Ubuntu

Debian

Amazon Linux

CentOS

Linux Architecture

The architecture of a Linux System consists of the following layers:

  • Hardware layer − Hardware consists of all peripheral devices (RAM/ HDD/ CPU etc).

  • Kernel − It is the core component of the Operating System, and interacts directly with hardware.

  • Shell − An interface to the kernel, from users. The shell takes commands from the user and executes the kernel's functions.

  • Application/Utilities − Utility programs that provide the user with most of the functionalities of an operating system.

Linux Folder Structure

Basic Linux Commands

CommandSyntaxExampleDescription
lsls [options] [directory]ls -l /home/userList files and directories in a directory.
cdcd [directory]cd /var/wwwChange the current directory.
pwdpwdpwdPrint the current working directory.
touchtouch [filename]touch file.txtCreate an empty file.
mkdirmkdir [directory]mkdir new_directoryCreate a new directory.
rmrm [options] [file/directory]rm file.txtRemove files or directories.
cpcp [options] source destinationcp file.txt /backupCopy files or directories.
mvmv [options] source destinationmv file.txt new_locationMove or rename files or directories.
catcat [file]cat textfile.txtDisplay the contents of a file.
moremore [file]more longfile.txtView file contents page by page.
manman [command]man lsAccess manual pages and documentation.
unameuname [options]uname -aDisplay system information such as the kernel name, network node hostname, kernel release, kernel version, machine hardware name, and processor type.
lsb_release -alsb_release [options] -alsb_release -aShow Linux Standard Base (LSB) and distribution-specific information about the operating system.
echoecho [options] [string]echo "Hello, World!"Print the specified string to the terminal.
catcat [options] [file]cat file.txtDisplay the contents of one or more files.
useradd -museradd [options] -m usernameuseradd -m johnCreate a new user account and create a home directory for the user.
susu [options] [username]su rootSwitch user to another account (usually to the root user).
rmrm [options] [file/directory]rm file.txtRemove files or directories.
rm -rfrm [options] -rf [directory]rm -rf /path/to/directoryRemove directories and their contents forcefully.
cd ..cd ..cd ..Move up one level in the directory structure to the parent directory.
cd ~cd ~cd ~Change the current working directory to the user's home directory.
cd /cd /cd /Change the current working directory to the root directory of the file system.

Day 2 Task

Task: What is the Linux command to

  1. Check your present working directory.

  2. List all the files or directories including hidden files.

3. Create a nested directory A/B/C/D/E

"Your time spent reading this blog/article is truly cherished. May your learning journey be filled with happiness and knowledge!"

*"Linux: The Cool Cat of the Operating System Jungle!"*🐱