History of Linux
- Linux is an open-source operating system (OS). It was originally conceived and created by Linus Torvalds in 1991.
- He originally intended to name it “Freax,” but the administrator of the server. Torvalds used to distribute the original code named his directory “Linux” after a combination of Torvalds' first name and the word Unix, and the name stuck.
- Linux was originally developed for personal computers based on the Intel x86 architecture but has since been ported to more platforms than any other operating system.
- Linux is a kernel and not an operating system and GNU is a collection of free software, these two project collabs give us "Linux" or the “GNU/Linux” operating system. Some companies and open source communities adopt GNU/Linux codebase, did some modifications, and created their version or distributions,
For Example:
RHEL (Red hat)
Fedora
Debian
Ubuntu
CentOS
Kali Linux
Architecture of Linux
Kernel:
- The kernel is one of the fundamental parts of an operating system. It is responsible for each of the primary duties of the Linux OS.
- Each of the major procedures of Linux is coordinated with hardware directly.
- It is the main layer between the OS and underlying computer hardware, and it helps with tasks such as process and memory management, file systems, device control and networking.
- The kernel is in charge of creating an appropriate abstraction for concealing trivial hardware or application strategies.
- Different types of the kernel are:
Monolithic Kernel
Hybrid kernels
Exo kernels
Microkernels
System Library:
It is a special type of function that is used to implement the functionality of the operating system.
Shell:
It is an interface to the kernel which hides the complexity of the kernel’s functions from the users. It takes commands from the user and executes the kernel’s functions.
Hardware Layer:
This layer consists of all peripheral devices like RAM/ HDD/ CPU etc.
System Utility:
It provides the functionalities of an operating system to the user.
Linux File Hierarchy Structure
The Linux File Hierarchy Structure or the Filesystem Hierarchy Standard (FHS) defines the directory structure and directory contents in Unix-like operating systems. It is maintained by the Linux Foundation.
/ (Root): Primary hierarchy root and root directory of the entire file system hierarchy.
/bin: Essential command binaries that need to be available in single-user mode; for all users, e.g., cat, ls, cp.
/boot: Boot loader files, e.g., kernels, initrd.
/dev: Essential device files, e.g., /dev/null.
/etc : Host-specific system-wide configuration files.
/home : Users’ home directories, containing saved files, personal settings, etc.
/lib : Libraries essential for the binaries in /bin/ and /sbin/.
/media: Mount points for removable media such as CD-ROMs (appeared in FHS-2.3).
/mnt: Temporarily mounted filesystems.
/opt: Optional application software packages.
/sbin : Essential system binaries, e.g., fsck, init, route.
/srv: Site-specific data served by this system, such as data and scripts for web servers, data offered by FTP servers, and repositories for version control systems.
/tmp: Temporary files. Often not preserved between system reboots, and may be severely size restricted.
/usr: Secondary hierarchy for read-only user data; contains the majority of (multi-)user utilities and applications.
/proc: Virtual filesystem providing process and kernel information as files. In Linux, corresponds to a procs mount. Generally automatically generated and populated by the system, on the fly
Linux Basic commands
pwd #It shows the present working directory.
ls #It shows available files and directories listed in the present working directory.
uname #It shows the name of Kernel(OS).
uname -r # It shows the version of kernel.
cd #To change the directory.
clear #To clear the screen.
whoami #It shows current login user name.
history #It shows a list of previously used commands.
date #It shows the date and time.
#Create directory:
mkdir <directoryname># To create directory .
#Ex. : mkdir test - create test directory.
mkdir <directoryname1><directoryname2><directoryname3> # To create multiple directory .
mkdir -p/<directoryname>/<childdirectoryname>/.... #To create directory path.
mkdir /<directoryname>{1..10} #To create multiple directory within a range.
#Create file:
touch <filename># create a file.
touch <filename1><filename2><filename3> # To create multiple files.
touch /<filename>{1..10} # To create multiple files within a range.
#Copy file:
cp <option><source><destination> # copy a file
#option :
#-r for recursive
#-v for verbose
#-r for forcefully
cp -rvf/root/D* / home #copy all files starting with D.
#Move or rename file & directory:
mv <source><destination># move a file or group of files to another directory.
mv <old name><new name> # rename file or directory.
#Remove file :
rm <filename># removes file
useradd <username>#create a user account:
passwd <username> #create a user account password
userdel <username> #delete user account
su (switch user) #switch user
Thank you, Readers, for giving your precious time to read my first-ever blog. I am open to your valuable suggestions to upskill myself. Glad to share my learnings of #DevOps in the #trainwithshubham community during the #90daysofdevops challenge. Your appreciation will motivate me to learn and share upcoming learnings.