Unix/Linux System: Features, Evolution, Commands, and Architecture

Unix/Linux System: A Comprehensive Overview

Features of Unix/Linux Systems

Unix/Linux systems are renowned for their robust features, including:

  • Multiuser and Multitasking: Multiple users can run programs concurrently.
  • Hierarchical File System: A tree-like structure for organized file management.
  • Shell as Command Interpreter: A powerful command-line interface for system interaction.
  • Portability and Compatibility: High portability across hardware platforms and software applications.
  • Networking Support: Facilitates communication and collaboration.
  • Security Features: File permissions, user authentication, and access controls ensure security.

Evolution of Unix/Linux

The evolution of Unix/Linux includes key milestones:

  • Birth at Bell Labs: Unix originated in the late 1960s.
  • C Programming Language: Development of C contributed to Unix’s success.
  • Unix Versions: Evolution through versions like Unix Version 6, 7, and BSD.
  • GNU Project: Aimed to create a free Unix-like OS.
  • Linux Kernel: Developed by Linus Torvalds in 1991, forming the basis of GNU/Linux.

VI Editor Modes

VI Editor operates in three modes:

  • Normal Mode: For navigation and text manipulation.
  • Insert Mode: For text input and editing.
  • Command-line Mode: For advanced commands like saving and searching.

User Mode Commands in VI Editor

Essential user mode commands include:

  • i (Insert): Enter insert mode before the cursor.
  • a (Append): Enter insert mode after the cursor.
  • o (Open a New Line Below): Insert a new line and enter insert mode.
  • d (Delete): Remove text.
  • y (Yank/Copy): Copy text.
  • p (Paste): Paste copied or deleted text.
  • u (Undo): Revert the last change.
  • r (Replace): Replace a character.

Command Mode Commands in VI Editor

Advanced command mode commands include:

  • :w (Write/Save): Save changes.
  • :q (Quit): Exit VI Editor.
  • 😡 (Save and Exit): Save changes and exit.
  • :d (Delete): Delete text or lines.
  • :yy (Yank/Copy Lines): Copy lines.
  • :dd (Delete Lines): Delete lines.
  • :s (Substitute): Replace text.
  • :g (Global Command): Perform a command on matching lines.

Architecture of Unix/Linux Systems

Unix/Linux systems have a layered architecture:

  • Kernel: Manages hardware resources and system operations.
  • Shell: User interface for command interpretation and execution.
  • Utilities: Programs and tools for additional functionality.
  • File System: Organizes data into a hierarchical structure.

File and Directory System

Key aspects of the file and directory system:

  • Hierarchical Structure: Tree-like organization of directories and files.
  • Root Directory (/): The top-level directory.
  • Absolute and Relative Paths: Specifying file locations.
  • Common Commands: ls, cd, pwd for navigation and management.

Roles of the Kernel

The kernel plays crucial roles:

  • Process Management: Creating, scheduling, and terminating processes.
  • Memory Management: Allocating and deallocating memory.
  • File System Management: Handling file operations.
  • Device Management: Managing devices and providing interfaces.

Windows vs. Linux/Unix

Key differences between Windows and Linux/Unix:

  • File Systems: NTFS vs. ext4 and other Linux/Unix file systems.
  • User Permissions: ACLs vs. simple read, write, and execute permissions.
  • System Architecture: Monolithic vs. modular kernel.

File and Directory Permissions

Permissions control access:

  • Read (r): View files or list directory contents.
  • Write (w): Modify or delete files.
  • Execute (x): Execute files or traverse directories.

Permissions are categorized for owner, group, and others and can be set using numeric or symbolic notation.

Frequently Used Linux Commands

Essential Linux commands:

  • ls: List files and directories.
  • cp: Copy files and directories.
  • mv: Move or rename files and directories.
  • rm: Remove files and directories.
  • mkdir: Create directories.
  • chmod: Change permissions.
  • grep: Search for patterns.
  • ps: Display process status.

Setting Permissions

Two ways to set permissions:

  • Numeric Notation: Using three-digit numbers (e.g., 755).
  • Symbolic Notation: Using symbolic characters (e.g., u+rwx).

MAN Commands

The man command provides access to detailed manual pages for commands and topics.

File/Directory Operations

Common operations include creating, deleting, copying, moving, and renaming files and directories.

File Attributes

File attributes provide information about files, including size, permissions, ownership, timestamps, and file type.

Path Names

Pathnames specify file locations:

  • Absolute Pathname: Full path from the root directory.
  • Relative Pathname: Path relative to the current working directory.