The Unix Way - Comprehensive Study Notes

The Unix Way

2.1 Unix History

  • Dennis Ritchie and Ken Thompson Quote:

    • "…the number of UNIX installations has grown to 10, with more expected…" - June 1972.

    • Background: The system development was sparked when AT&T’s collaboration with MIT and GE on a project called Multics ended in March 1969.

    • Multics stands for "Multiplexed Information and Computing Service," which enabled multiple users to access a single computer simultaneously, a technique only conceived in the past decade before UNIX's development.

  • Background of Development:

    • The initial UNIX system named UNICS (a pun on Multics) was created to rewrite an operating system for a smaller machine, namely the DEC PDP-7 with a mere 4K memory for user programs.

    • Ken Thompson and Dennis Ritchie were pivotal figures in the creation of UNIX at AT&T's Bell Laboratories in the late 1960s, developing version 1 on the PDP-7 due to Thompson’s experience with it.

  • Educational Enhancement:

    • In the mid-1970s, Thompson taught UNIX at the University of California, Berkeley, leading to the Berkeley Software Distribution (BSD).

    • AT&T continued its efforts, leading to the release of System V in 1983, culminating an active collaboration and enhancement of UNIX-based systems.

  • Broader Adoption and Legacy:

    • Various innovations by companies like Sun Microsystems and Silicon Graphics resulted in the growth of UNIX, which inspired open-source systems like FreeBSD and Linux, and contributed to Apple Inc.’s Mac OS X.

2.1.2 Brief History of Linux

  • Linus Torvalds:

    • Initiated Linux in 1991 aiming to create a superior alternative to MINIX, a UNIX-like operating system used mainly in educational settings.

    • MINIX was criticized for limiting users’ ability to modify and distribute the code.

  • Development of Kernel:

    • Linus primarily utilized the C programming language in creating the Linux kernel, utilizing the groundwork established by Richard Stallman’s GNU project.

    • The first version, Linux 1.0, was released in 1994, with Red Hat and Suse becoming the pioneering Linux distributions.

  • Growth in Popularity:

    • Over a decade, Linux expanded to compatibility across thousands of devices, gaining endorsements from corporations like Compaq, HP, and Dell, which first introduced Linux throughout its entire product line.

  • Five Key Facts about Linux:

    • Linux is free and open source.

    • It is compatible with millions of digital devices.

    • Created by Linus Torvalds in the early 1990s.

    • Utilized in servers, data centers, and supercomputers.

    • Written predominantly in C programming language.

2.1.3 Open Source

  • Concept of Open Source:

    • In contrast to proprietary software where source code is a trade secret, open-source software provides unrestricted access to source code, a fundamental aspect during Unix's development which catered primarily to engineers and advanced users.

  • Access and Development:

    • Unix was inherently open, released with its source code prior to the formal concept of "Open Source" becoming commonplace.

    • Various commercial versions emerged due to this openness, allowing for developments like BSD with permissive licensing.

  • Freedom in Computing:

    • Linux offers unparalleled freedom compared to proprietary systems like those from Microsoft and Apple, which tend towards creating restrictive environments.

    • Different from Windows or macOS, Linux is represented by numerous distributions (distros) catering to various needs.

2.2 Basic Linux Concepts and Features

The Shell
  • Origins:

    • All shells derive from the Bourne Shell (sh), created by Steve Bourne.

    • Bash stands for Bourne-again shell, an improved version of sh.

  • Functionality of Shell:

    • Acts as a user interface to the operating system, facilitating communication with the kernel and executing user commands.

    • Shells provide either command-line interfaces (CLI) or graphical user interfaces (GUI).

  • Shell Capabilities:

    • Users employ the shell to execute commands, manipulate files, manage file permissions, and handle directories.

    • Accessed through a terminal or console displaying a command prompt.

  • Scripting Language:

    • The default shell in most Linux systems is based on the Bash scripting language.

Linux Kernel
  • Core Component:

    • The Linux kernel is considered the heart of Linux operating systems, providing a foundational platform for executing applications and services.

    • The kernel can be customized to meet specific user requirements, ensuring flexibility and adaptability.

  • Integrated Platform:

    • The collaborative functioning of the Linux Operating System with the kernel creates a robust and user-friendly computing environment.

2.2.3 Manual Pages and Documentation

Linux Man Page Entries
  • Manual Pages (man pages):

    • Serve as documentation manuals listing different commands within UNIX-like operating systems.

    • To access a command's manual entry, users can execute:
      man command_name.

  • Structure of Manual Entries:

    • The entry format includes a header, such as PRINTF(1) where the number signifies the section of the manual.

Sections of the Manual
  • The manual is divided into 8 sections:

    • 1: General Commands

    • 2: System Calls

    • 3: Library functions, particularly C standard library

    • 4: Special files (e.g., devices in /dev) and drivers

    • 5: File formats and conventions

    • 6: Games and screensavers

    • 7: Miscellaneous

    • 8: System administration commands and daemons

Conclusion
  • Understanding the history, development, core features, and documentation of UNIX and Linux systems is crucial for any advanced user or developer looking to navigate and utilize these systems effectively.