Linux history and Fundamentals
- What is Linux and history of linux?
- Linux system architecture
- Advantages of Linux.
- Some of the basic commands of linux which are used by a DevOps and Linux admin in routine:
1) What is Linux and
history of linux?
Technology has for decades depended on Linux, an open-source, Unix-like operating system kernel that powers numerous Linux versions. Linux’s creator, Linus Torvalds, is credited with giving Linux its defining characteristics of stability, security, and adaptability in 1991. Linux is unique in that it works with a wide range of hardware, which includes giant servers to personal computers.
The origins of Linux may be traced back to Linus Torvalds, a computer science student from Finland who started working on an operating system kernel that resembled Unix. When Linus published his project in 1991 under the GNU General Public License, it sparked an international contributor community. Linux has developed into a strong and adaptable operating system over time. It is widely used in embedded systems, desktop computing, high-performance computing, and server contexts. The popularity of Linux serves as a testament to the enormous potential of community-driven software and the strength of open source and collaborative development.
2) Linux system architecture
Linux architecture involves multiple layers, including hardware, kernel, shell, and applications, which communicate as follows:
Hardware to Kernel: Hardware communicates with the kernel through device drivers. These drivers act as intermediaries, enabling the kernel to control hardware components, like the CPU, memory, storage, and peripherals.
Kernel to Shell: The kernel provides a system call interface, which allows the shell (command-line interface) to request services and interact with the kernel. For example, the shell can request file operations or process management via system calls.
Shell to Applications: The shell acts as an interface between the user and applications. It interprets user commands and launches applications. It can also pass data between applications, facilitating communication among them.
This layered communication ensures that hardware is managed by the kernel, which, in turn, facilitates user interaction via the shell and application execution while maintaining security and resource management.
3) Benefits of Linux.
Linux has a number of significant benefits, some are listed below:
Stability: Linux is a great option for servers and crucial applications because of its well-known stability and dependability, which developers desire.
Security: Linux is less vulnerable to viruses and malware because of its strong permission structure and proactive security measures.
Customization: Users can modify Linux to meet their own requirements and tastes, making it a very flexible operating system.
Cost-effective: Because Linux is open source, it is frequently offered for free, which lowers the cost of software.
Community Support: To ensure that users may get assistance when needed, the worldwide Linux community provides a wealth of documentation and support resources.
Scalability: Linux is suited for both small and large projects because of its easy scaling to manage varied demands.
Versatility: Linux offers freedom and choice and may be used for a wide range of applications, including web servers and mobile devices.
In simple terms, Linux promotes open collaboration, flexibility, and the game-changing potential of open source software. It is more than just an operating system.
4) Some of the basic commands of linux which are used by a DevOps and Linux admin in routine:
File and Directory Commands:
ls: List files and directories.
pwd: Print the working directory.
cd: Change the current directory.
mkdir: Create a new directory.
rmdir or rm -r: Remove a directory.
touch: Create an empty file.
cp: Copy files and directories.
mv: Move or rename files and directories.
rm: Remove files.
File Viewing and Editing:
cat: Display file contents.
less or more: View file content one screen at a time.
head and tail: Display the beginning or end of a file.
nano or vim or vi: Text editors for editing files.
File Permissions:
chmod: Change file permissions.
chown: Change file ownership.
chgrp: Change group ownership.
File Searching:
find: Search for files and directories.
grep: Search for patterns in text files.
Get Kunal Barot’s stories in your inbox
Join Medium for free to get updates from this writer.
Archiving and Compression:
tar: Archive files and directories. gzip, gunzip, bzip2,
unzip: Compress and decompress files.
Process Management:
ps: List running processes.
top or htop: Monitor system processes in real-time.
kill: Terminate processes.
User and Group Management:
passwd: Change user password.
useradd and userdel: Add or delete user accounts.
groupadd and groupdel: Add or delete groups.
su and sudo: Switch user or execute commands with superuser privileges.
Networking:
ping: Check network connectivity.
ifconfig or ip: Configure network interfaces.
netstat or ss: Display network statistics.
ssh: Securely connect to remote systems.
System Information:
uname: Display system information.
df: Display disk space usage.
free: Display memory usage.
date: Display or set the system date and time.
Package Management (Package-Specific):
apt (Debian/Ubuntu), yum (RHEL/CentOS), dnf (Fedora): Package management for installing and updating software packages.
These are only some of the multiple commands that are available in Linux. Every command contains a number of options that can be used to carry out increasingly complicated tasks. By running man command_name, you can access the manual pages for these commands and find out more about their possibilities and usefulness.
For example:
we will see how ls and mkdir command with some options can be used.
ls COMMAND:
- ls -l — here “-l” option will list the files and directories in long list format with extra information
- ls -a — here “-a” option will list all including hidden files and directory
- ls *.sh — here “*”.sh option will list all the files having .sh extension.
- ls -i — here “-i ”option willlist the files and directories with index numbers inodes
- ls -d */ — here “-d */” option will list only directories.(we can also specify a pattern)
mkdir COMMAND:
- mkdir dev1 — make a new folder ‘ dev1’
- mkdir . dev1 — make a hidden directory (also . before a file to make it hidden)
- mkdir dev1 dev2 dev3 dev4 — make multiple directories at the same time
- mkdir /home/user/dev1 — make a new folder in a specific location
- mkdir -p dev1/dev2/dev3/dev4 — make a nested directory.
Here is the directory structure of Linux: