Delving into Linux History, Shells, and Commands - Week Five

Shubham Murti - Oct 2 - - Dev Community

Hello Community!

This week, I dove deeper into the history of Linux, the role of GNU, and the importance of shells. I also explored the top Linux commands and the various Linux families. Here’s a detailed summary of what I learned:

Understanding Linux and GNU

Linux Kernel

The Linux kernel is the core part of the operating system, responsible for managing system resources and enabling communication between hardware and software components. It is the fundamental layer that interacts directly with the hardware, ensuring efficient operation and resource management.

GNU Project

Started by Richard Stallman in 1984, the GNU Project aimed to create a collection of free software. While it provided most of the necessary components for an operating system, it lacked a kernel. The GNU Project’s goal was to promote software freedom and to provide users with control over their computing environments.

Combining Forces

The combination of Linus Torvalds’ Linux kernel with the GNU components resulted in a fully functional operating system. This synergy allowed for the creation of what we commonly refer to as GNU/Linux, a powerful and flexible OS used globally.

History and Recognition

Although Linus Torvalds developed the Linux kernel in 1991, Richard Stallman’s GNU Project played a crucial role in its development and adoption. The collaboration between the two efforts exemplifies the power of open-source communities.

Unix and Unix-like Systems

Unix, which originated in the 1970s, is a trademarked operating system. Unix-like systems, including Linux, follow the principles of Unix but are not certified as Unix. These systems share design philosophies and features, making them robust and reliable choices for various applications.

Shells and Their Roles

Function of Shells

Shells serve as command interpreters, executing user commands and acting as an interface between the user and the kernel. They allow users to interact with the system through a command-line interface, enabling powerful and flexible system management.

Popular Shells

  • Bash: The default shell on most Linux distributions and macOS, known for its simplicity and effectiveness.
  • Zsh: Known for its powerful features and customization options, Zsh offers advanced functionality for users who require more than what Bash provides.
  • fish: User-friendly with advanced scripting capabilities, fish is designed to be intuitive and easy to use, making it a great choice for both beginners and experienced users.

Top 50 Linux Commands

I explored essential commands for navigating and managing a Linux system, covering file manipulation, process management, system monitoring, and more. Here are some key commands:

File Manipulation

  • whoami: Displays the current logged-in username.
  • man: Opens the manual for other commands.
  • clear: Clears the terminal screen.
  • pwd: Displays the current directory path.
  • ls: Lists directory contents.
  • cd: Changes the current directory.
  • mkdir: Creates a new directory.
  • touch: Creates an empty file or updates the timestamp of an existing file.
  • rmdir: Removes empty directories.
  • rm: Removes files or directories.
  • xdg-open [filename]: Opens a file with the default application.
  • mv: Moves or renames files and directories.
  • cp: Copies files and directories.
  • head: Displays the first few lines of a file.
  • tail: Displays the last few lines of a file.
  • date: Displays or sets the system date and time.

Output Redirection

  • > (redirecting + overwrite): Redirects output to a file, overwriting its contents.
  • >> (redirecting + appending): Redirects output to a file, appending to its contents.
  • cat: Concatenates and displays file contents.
  • less: Allows viewing of file contents one page at a time.
  • echo: Outputs text to the terminal or a file.
  • wc: Word, line, and byte count for files.
  • | (Piping): Passes the output of one command as input to another.

Sorting and Searching

  • sort: Sorts lines of text.
  • diff: Compares files line by line.
  • grep: Searches for patterns in files.

System Monitoring

  • du: Displays disk usage.
  • df: Displays disk space usage.
  • history: Shows command history.
  • ps: Displays currently running processes.
  • top: Provides a dynamic, real-time view of running processes.
  • kill: Sends a signal to a process, usually to terminate it.
  • killall: Kills all processes with a given name.
  • jobs, fg, bg: Manages jobs in the shell.

Compression and Archiving

  • gzip: Compresses files.
  • tar: Archives files.

Text Editors

  • nano: A simple text editor.
  • alias: Creates shortcuts for commands.
  • xargs: Constructs argument lists and executes commands.
  • ln: Creates hard and symbolic links.

User and Permission Management

  • who: Displays who is logged on.
  • su: Switches to another user.
  • sudo: Executes commands as the superuser.
  • passwd: Changes user passwords.
  • chown: Changes file ownership.

File Permissions

  • chmod: Modifies file permissions.

Understanding the File System

File Permissions

Permissions in Linux determine the level of access for users and groups. They are divided into three categories: owner, group, and world (others).

Permission Notation

Permissions are represented using a series of symbols. For example, -rw-r--r-- indicates that the owner has read and write permissions, while the group and others have read-only permissions.

Changing Permissions

The chmod command is used to change file permissions. For example, chmod 755 filename grants the owner read, write, and execute permissions, while the group and others get read and execute permissions.

Understanding Linux Families

Red Hat Family

Known for enterprise-grade distributions, the Red Hat family includes Red Hat Enterprise Linux (RHEL), CentOS, and Fedora.

  • RHEL: Aimed at commercial use with a focus on stability and long-term support.
  • CentOS: A free, community-supported alternative to RHEL.
  • Fedora: Known for being cutting-edge and often serves as a testing ground for new features before they are included in RHEL.

SUSE Family

Includes SUSE Linux Enterprise Server (SLES) and openSUSE, both known for their stability and enterprise features.

  • SLES: Designed for enterprise environments with robust support and advanced features.
  • openSUSE: A versatile distribution that caters to both developers and system administrators, offering rolling release and stable versions.

Debian Family

Includes Debian, Ubuntu, and many derivatives, known for ease of use and extensive software repositories.

  • Debian: Known for its stability and vast software repository.
  • Ubuntu: Based on Debian, it is user-friendly and widely used both on desktops and servers.
  • Derivatives: Many distributions are based on Ubuntu, offering various user experiences and specializations.

Closure

This week has been enlightening as I deepened my understanding of Linux history, the role of shells, and essential commands. Mastering these concepts is critical for anyone pursuing a career in cloud engineering or system administration. From the origins of Linux and GNU to practical command-line skills, these foundations will significantly enhance my capabilities in managing and operating Linux systems.

Thanks for following along on my journey! Feel free to share any tips or resources that you think might be helpful. 😊

Stay tuned for more updates next week!

Shubham Murti — Aspiring Cloud Security Engineer | Weekly Cloud Learning !!

Let’s connect: Linkdin, Twitter, Github

. . . . . . . . . . . . . . . . .
Terabox Video Player