Linux is a versatile and powerful operating system that has gained immense popularity in recent years. Linus Torvalds founded the Linux operating system in 1991. Inspired by the Unix operating system, Linux was designed to be free and open-source, meaning anyone can contribute to its development. This has led to a wide variety of Linux distributions, each with its unique features and target audience.
The Linux operating system comprises several different pieces :
- Bootloader : The software that manages the boot process of your computer. For most users, this will simply be a splash screen that pops up and eventually goes away to boot into the operating system.
- Kernel : This is the core of the Linux operating system, which interacts with the hardware and manages system resources such as memory, CPU, and storage. The kernel is the lowest level of the OS.
- Init System : This is a sub-system that bootstraps the user space and is charged with controlling daemons. One of the most widely used init systems is systemd? which also happens to be one of the most controversial. It is the init system that manages the boot process, once the initial booting is handed over from the bootloader (i.e., GRUB or GRand Unified Bootloader).
- Daemons : These are background services (printing, sound, scheduling, etc.) that either start up during boot or after you log into the desktop.
- Shell : This is the interface between the user and the operating system, which allows the user to interact with the system by typing commands and receiving feedback.
- Graphical Server : This is the sub-system that displays the graphics on your monitor. It is commonly referred to as the X server or just X.
- Utilities : These are the software tools that perform specific tasks, such as managing files and directories, processing data, and communicating with other systems.
- Desktop Environment : This is the piece that the users actually interact with. There are many desktop environments to choose from (GNOME, Cinnamon, Mate, Pantheon, Enlightenment, KDE, Xfce, etc.). Each desktop environment includes built-in applications (such as file managers, configuration tools, web browsers, and games).
- Applications : These are the software programs that run on top of the operating system and provide specific functionality to the user, such as word processors, web browsers, and media players.
Together, these different pieces of the Linux operating system work together to provide a powerful, flexible, and customizable platform for computing.
Types of Linux Distributions
There are countless Linux distributions available, but some of the most popular ones include:
- Arch: Known for its flexibility and user-centric approach, Arch is a rolling release distribution that requires manual configuration.
- Debian: A stable and well-supported distribution that serves as the foundation for many other Linux distributions.
- Red Hat: A commercial distribution often used in enterprise environments due to its reliability and security features.
- Slackware: One of the oldest Linux distributions, Slackware is known for its simplicity and adherence to Unix principles.
Among these, Debian and Red Hat derivatives, such as Ubuntu and Fedora, respectively, are particularly popular due to their user-friendliness and extensive community support.
Installation
Installing Linux can be done in several ways:
- As Core Operating System : This involves replacing your existing operating system with Linux, making it the primary operating system on your computer.
- Dual Boot: This involves installing Linux alongside your existing operating system (windows or any other linux os), allowing you to choose which one to boot into.
- Virtual Machine: A virtual machine creates a simulated computer environment within your current operating system, making it a convenient way to try out Linux without affecting your main system.
The Command Line
The command line is a text-based interface that allows you to interact with the Linux system using commands. Each command is typically followed by options and arguments that specify how the command should be executed.
Shell
A shell is a program that interprets and executes commands entered by the user. Common shells include:
- Bash: The default shell on many Linux distributions.
- Zsh: Known for its powerful features and customization options.
Command Syntax
The basic syntax for a Linux command is:
command -option1 -option2 argument1 argument2
For example, to list the hidden contents of the Download directory, you would use the `ls` command with these option and argument:
ls -la ~/Download/
ls = Command
-la = Option
~/Download/ = Argument
Basic Commands
Understanding Linux and the basic Linux commands are critical prereqs for a cyber competition. you can also enroll for our free course Linux Masterclass to learn more about linux commands. Below are basic examples of important Linux commands.
- ls - list directory content
- cat - view file contents
- file - determine file type
- mkdir - make directory
- rmdir - remove directory
- cp - copy files and directories
- mv - move files and directories
- rm - remove files and directories
- touch - create a blank file
- wc - count words, lines or chars
- sort - sort the content of a file
- head - print first few lines
- tail - prints last 10 lines( default)
- pwd - print the current working directory
- whoami - display the current user
- history - list previous commands
- locate - find files and directories
- find - search file, dir or necessery data in specified location
- grep - search for data in files
- su - change user or superuser
- sudo - temporarily superuser
- chmod - modify file access rights
- chown - change file ownership
- chgrp - change group ownership
- man - help details
- zip - create and extract zip
- free - free and used ram
- uname - basic system info including kernel name, version, and release.
Example: :
To create a new directory named "projects" and then create a file named "index.html" within it, you would use the following commands:
mkdir projects
cd projects
touch index.html
Conclusion
Linux is a versatile and powerful operating system that offers a wide range of features and benefits. By understanding the basics of Linux and mastering essential commands, you can unlock its full potential and customize your computing experience.
Learning Resources
- Our Linux Resources : https://hacktronian.in/learn/linux
- Linux Documentation Project: https://www.linuxdoc.org/index.html
- The Linux Foundation: https://www.linux.org
- Online tutorials and courses: Many websites offer tutorials and courses on Linux, catering to different skill levels.