Linux
Linux is an open-source operating system for personal computers (PCs), workstations, and servers, distinguished by its power, flexibility, and free availability.
Operating system acts as the bridge between your computer’s hardware and software.
It provides professional-level Internet services, extensive development tools, fully functional Command line interface (CLI) and Graphical user interfaces (GUIs), and a vast number of applications.
Origin and History
- Linux was developed in the early 1990s by Linus Torvalds along with other programmers globally.
- It is technically a PC version of the Unix operating system. Unix was developed at AT&T Bell Laboratories in the late 1960s and early 1970s in a research and academic environment, emphasizing flexibility.
- The Free Software Foundation's GNU Project played a significant role in its development, providing much of the open-source software bundled with Linux distributions. Richard Stallman founded the Free Software movement, started the GNU Project, and created the GNU General Public License (GPL).
- Linux was originally designed for Intel-based PCs and started as a personal project by Linus Torvalds at the University of Helsinki. He released version 0.11 in 1991, intending to create an effective PC version of Unix for Minix users.
Key Characteristics
- Open Source and Free: Linux has evolved as part of the open-source software movement, where independent programmers provide free, high-quality software. Its source code is freely distributed and available on the Internet. Linux is copyrighted but distributed under a GNU General Public License (GPL), ensuring it remains free and standardized.
- Unix-like Functionality: Linux performs many of the same functions as Unix, Macintosh, Windows, and Windows NT. It provides the speed, efficiency, scalability, and flexibility of Unix to PCs. It is a multiuser and multitasking system, allowing multiple users to log in and perform several tasks concurrently.
- Graphical User Interfaces (GUIs): Linux provides GUIs like GNOME and KDE, which offer a high level of flexibility and power, allowing users to choose and customize their interface with panels, applets, virtual desktops, and menus. The X Window System underlies these GUIs.
- Stability and Power: Many consider Linux far more stable and powerful than other PC operating systems, making it a preferred choice for network servers. In its simplest form, Linux can run effectively on as little as 2MB of memory.
- Networking Features: Linux distributions include powerful networking features, supporting Internet, intranets, and Windows networking. It comes with fast, efficient, and stable Internet servers such as web, FTP, DNS, proxy, news, and mail servers.
The Philosophy: Open Source, FSF, and GNU
Linux emerged as part of the open-source software movement, where independent programmers collaborate to provide free, high-quality software to users.
- Open Source Software (OSS): The core idea behind open source software is that the source code for an application is freely distributed along with the application itself. This allows programmers globally to contribute to development, modify, and correct the code. Linux itself is an open-source operating system, with its source code included in all distributions and readily available online. This transparency ensures that the system is "without secrets," allowing anyone to examine and study how it works.
- Free Software Foundation (FSF) and the GNU Project: The FSF, founded by Richard Stallman, played a significant role in Linux's development. Stallman, a "genius-philosopher," started the GNU Project ("GNUs Not Unix") to provide free software to users, programmers, and developers.
- GNU General Public License (GPL): Linux is copyrighted but distributed under the GNU GPL. This license ensures that Linux remains free and standardized, meaning the software and any modifications made to it must always be freely available. This licensing model prevents commercial entities from taking control of open-source software by copyrighting their modifications and selling them as proprietary products.
Linux Distributions
Think of Linux as an engine. A car engine is powerful, but it's not a complete car. A Linux distribution takes the Linux "engine" (called the kernel) and adds all the parts you need to make a complete, usable operating system: a package manager, desktop environment, software suite, and more.
It's like different car models built around the same core technology. A sports car and a truck have the same basic goal (transportation) but are designed for different users and purposes.
Here's a look at some prominent distributions:
1. Ubuntu
- It's the most popular desktop Linux distro. Ubuntu focuses on ease of use, has a huge community, and tons of online help. It "just works" out of the box with easy driver installation and a polished user experience.
- Best for: Beginners, developers, and those coming from Windows/macOS.
2. Linux Mint
- Based on Ubuntu, it's incredibly user-friendly and stable. It comes with multimedia codecs pre-installed, so you can play videos and music immediately.
- Best for: Absolute beginners who want a familiar, Windows-like experience.
3. Debian
- Debian is one of the oldest and most stable distros. Ubuntu is actually based on it! Debian values free software and stability over having the very latest software versions. A great "set it and forget it" choice.
- Best for: Purists, servers, and systems where rock-solid stability is critical.
4. Fedora
- Why? Sponsored by Red Hat, Fedora is a cutting-edge platform that often features the newest kernel and software versions. It's very secure and innovative but can be less stable than Ubuntu/Debian. A great desktop OS for tech professionals.
- Best for: Developers, enthusiasts, and those who want the latest open-source technology.
5. CentOS Stream / Rocky AlmaLinux
- Why? These are 1:1 clones of Red Hat Enterprise Linux (RHEL), the giant of the corporate Linux world. They are incredibly stable, secure, and long-supported. Learning CentOS/Rocky is directly valuable for many IT jobs. (Note: CentOS has shifted to a rolling-release model called CentOS Stream).
- Best for: Enterprise users, sysadmins, and web servers.
Linux File System Structure
If you're coming from Windows, you're used to drives having letters (C:, D:). In Linux, there are no drive letters. Instead, there is a single, unified filesystem tree that starts from the root directory, denoted by a single forward slash /.
All other directories branch off from this root.
Physical storage devices (hard drives, USBs, CDs) are then "mounted" (attached) to specific directories within this tree. This might seem strange at first, but it's a powerful and flexible system.
The structure of this tree is largely defined by the Filesystem Hierarchy Standard (FHS), which ensures that everyone knows where to find things.
Root Directory (/)
- The root directory (/) is the beginning of the entire Linux file system structure and forms the base of its hierarchical tree.
/home Directory
-
The
/homedirectory is designated to contain users' home directories. -
When a user logs in, their current working directory is typically their home directory, which is usually named after their login name (e.g.,
/home/techonquerfor usertechonquer).
/etc Directory
-
The
/etcdirectory is critical as it holds all system-wide configuration files. These files control the behavior of the system, network services, applications, and user settings.
/bin Directory
-
The
/bindirectory contains binaries (executable programs) that are essential for the system to boot and run.
/var Directory
-
The
/vardirectory tree is designated for storing data that is likely to change or vary during the system's operation.
/tmp Directory
-
The
/tmpdirectory is designated for temporary files created by various program.
/usr Directory
-
The
/usrdirectory tree is typically the largest on a Linux system. It contains all programs and support files used by regular users, providing applications, libraries, and documentation.
/opt Directory
-
The
/optdirectory is used for installing "optional" software packages, typically commercial software product.
/dev Directory
-
The
/devdirectory is a special directory that contains device files. These files provide interfaces for devices attached to the system, such as terminals, printers, hard drives, and CD-ROMs.
/lib Directory
-
The
/libdirectory holds essential shared libraries and kernel modules required by the system. -
It contains the main Linux library,
libc.
Interactive Challenge: Filesystem Explorer
Objective: Use the terminal to navigate and explore the FHS.
- Open your terminal.
-
Navigate to Root: Type
cd /and press Enter. You are now at the base of the filesystem. -
List Contents: Type
lsto see the directories listed above. Do you see/bin,/etc,/home, and/usr? -
Explore Your Home: Type
cd ~or justcdto go directly to your home directory. Now typepwdto confirm your location. This is your personal workspace. -
Look at Configs: Type
cd /etc. Usels | grep hostto find files related to "hosts". You can view the/etc/hostsfile withcat hosts. -
Check Logs: Type
cd /var/log. Uselsto see the system log files. You can view the end of the main system log withsudo tail -f syslog(pressCtrl+Cto exit the live view).