Linux basics for students

🧠 Introduction to Linux and Its Utilities

Welcome to your study guide on Linux! Linux is one of the most powerful, stable, and open-source operating systems used across servers, desktops, and embedded devices. In this post, we’ll explore its history, architecture, features, essential commands, editors, and shells — all explained simply for students and beginners.


📜 A Brief History of Linux

Linux was created in 1991 by Linus Torvalds while he was a student at the University of Helsinki. Inspired by UNIX, he built a free and open-source kernel, which quickly evolved with help from developers around the world.

  • UNIX foundation: Linux follows UNIX design principles like multi-user and multitasking.
  • Open source: Anyone can view, modify, and distribute Linux source code.
  • Community-driven: Thousands of developers contribute to Linux distributions (distros).

🏗️ Linux Architecture

Linux architecture is modular, consisting of several layers:

  1. Hardware: Physical components like CPU, RAM, and disks.
  2. Kernel: The core that manages hardware, memory, processes, and devices.
  3. Shell: Interface between user and kernel for executing commands.
  4. System Utilities: Basic tools for managing files, processes, and system operations.
  5. Applications: User programs like browsers, editors, and servers.

✨ Features of Linux

  • Open-source and free to use
  • Multitasking and multi-user environment
  • High security with permissions and ownership
  • Portable and customizable
  • Support for networking and scripting

🗂️ Understanding the Linux File System

Linux uses a hierarchical directory structure starting from the root (/):

  • /bin – Basic commands and utilities
  • /home – User directories
  • /etc – Configuration files
  • /usr – User programs
  • /var – Log and variable data
  • /dev – Device files

🐧 Linux Distributions

Linux is available in various forms called distributions (distros), each with its own package management system and interface:

  • Ubuntu: Beginner-friendly and widely used
  • Debian: Stable and community-supported
  • Fedora: Cutting-edge Red Hat-based distro
  • Arch Linux: Lightweight and customizable
  • Kali Linux: Security-focused distribution

💻 Linux Console and Desktop

The Linux console is a command-line interface that allows users to interact directly with the system.

Linux also supports multiple desktop environments for GUI-based interaction:

  • X-Windows (X11): The base graphical windowing system
  • KDE Plasma: Modern, customizable desktop
  • GNOME: Clean, simple, and widely used interface

🧰 Linux Commands and Utilities

🔹 General Purpose Utilities

  • date – Display system date/time
  • cal – Show calendar
  • uptime – Display system running time

🔹 File Handling Utilities

  • ls – List directory contents
  • cp – Copy files
  • mv – Move or rename files
  • rm – Remove files
  • cat – View file content

🔹 Process Management

  • ps – List processes
  • top – Monitor active processes
  • kill – Terminate a process

🔹 Simple Filters

Filters process text data line-by-line.

  • sort – Sort lines
  • uniq – Remove duplicate lines
  • wc – Count words, lines, and characters

🔹 Regular Expression Filters – grep

  • grep 'pattern' filename – Search for a text pattern
  • egrep and fgrep – Extended and fixed pattern search

✍️ Advanced Filters and Editors

  • AWK: A pattern scanning and processing language
  • sed: Stream editor for modifying text automatically

Common Linux Text Editors

  • vi/vim – Classic text editor
  • nano – Simple and beginner-friendly
  • gedit – GNOME GUI text editor
  • GNU Emacs – Powerful text editor and IDE
  • Kwrite, Bluefish, gVim – GUI-based editors

🐚 Introduction to Shells

The shell is the command interpreter that allows users to run programs and manage the system. Popular shells include Bash, Zsh, and Fish.

Key Shell Concepts

  • Standard Streams: Input (stdin), Output (stdout), Error (stderr)
  • Redirection: >, <, >> for redirecting input/output
  • Pipes: | connects multiple commands
  • Tee Command: Sends output to both screen and file
  • Command Execution: Commands are read, interpreted, and executed sequentially
  • Variables: Store values; $HOME, $USER, etc.
  • Job Control: Run, suspend, and background tasks (jobs, fg, bg)

🧩 Filters and Pipes

  • cat – Combine and display files
  • head / tail – Show beginning or end of files
  • cut / paste – Extract or merge data columns
  • sort – Sort file contents
  • tr – Translate or delete characters
  • uniq – Filter duplicate lines
  • wc – Count words, lines, and characters
  • diff – Compare files line by line

🔍 Grep and Sed

grep

  • Used for searching text using patterns.
  • Example: grep "main" *.c

sed

  • Stream Editor for text manipulation.
  • Commands like s/pattern/replacement/ for substitution.
  • Used in shell scripts for automation.

🗃️ Unix File Structure and File Management

Every file in Linux is represented by an inode (index node) containing metadata such as ownership, permissions, and timestamps.

Key File System Concepts

  • File descriptors: Numeric references to open files.
  • System calls: Low-level operations to interact with the kernel.
  • Device drivers: Bridge between hardware and the OS.

Common File Management System Calls

create, open, close, read, write, lseek, link, symlink, unlink,
stat, fstat, lstat, chmod, chown

Directory API Functions

opendir(), readdir(), closedir(), mkdir(), rmdir(), umask()

🧩 Practice Linux Online

You can practice Linux commands and shell scripting directly in your browser using:

👉 Try Linux Online at bashweb.pages.dev


✅ Summary

Linux is more than an operating system—it’s a complete ecosystem for programmers, administrators, and learners. By mastering commands, file systems, and editors, you gain full control of your computing environment.


Written for learners by Saksham Shekher — MCA student, web developer, and Linux enthusiast.

Post a Comment