Download The UNIX Operating System and more Study notes Operating Systems in PDF only on Docsity!
The UNIX Operating
System
HORT 59000
Lecture 2 Instructor: Kranthi Varala
Operating Systems
Image By Golftheman - Own work, CC BY-SA 3.0, https://commons.wikimedia.org/w/index.php?curid=
- Operating systems allow the separation of hardware management from applications/programs.
- This allows the applications to work across different hardware platforms, although the applications are still specific to the OS.
Client/Server architecture
User User User User
Server
(UNIX/ Web/ Database etc..)
Terminology
- Terminal: Device or Program used to establish
a connection to the UNIX server
- Shell: Program that runs on the server and
interprets the commands from the terminal.
- Command line: The text-interface you use to
interact with the shell.
UNIX and its derivatives
Image by Eraserhead1, Infinity0, Sav_vas - Levenez Unix History Diagram, Information on the history of IBM's AIX on ibm.com, https://commons.wikimedia.org/w/index.php?curid=
Application Programming Interface (API)
- Biggest strength is the ability to connect different programs together.
- Programs/Applications need to be able to communicate.
- A pre-defined set of methods to communicate with an application is called it’s API.
- Each program comes with its own API.
POSIX standards
- Standards defined by IEEE computer society to maintain portability between different UNIX OS’s.
- Originally defined standard API for core processes eg., kernel level access.
- Later expanded to include programs and utilities used directly by the user.
- Net result: Common UNIX commands you learn will be usable across UNIX/ Linux/MacOS etc.
- UNIX and MacOS (version 10.5 and above) are POSIX-certified
UNIX and its derivatives
Image by Eraserhead1, Infinity0, Sav_vas - Levenez Unix History Diagram, Information on the history of IBM's AIX on ibm.com, https://commons.wikimedia.org/w/index.php?curid=
GNU/Linux OS
- Most Unix-like operating systems are a variant of this scheme.
- Linux is typically the kernel of this OS.
- The rest of the utilities/applications were derived from the GNU project.
- Vast majority of commands you will type fall into the GNU portion of the OS.
- This user-interfacing part of the OS is often called User space.
- GNU/Linux is POSIX-compliant i.e., it mostly follows POSIX with a few exceptions.
User vs. Kernel space
- User space: Set of applications/utilities that interact with the user. Also includes, the portions of the file system where these files reside AND the portion of memory (RAM) where the programs are loaded and run.
- Kernel space: Set of applications that form middle layer between hardware and user applications. These program operate in a separate, protected portion of the RAM.
Files and Directories
- Files are the basic unit of storage. Eg., This presentation file.
- Directories are containers that hold sets of related files. Eg., Set of presentations for this course.
- Each file name within a directory has to be unique.
- UNIX is case-sensitive i.e., the file example.txt is different from the file Example.txt
- Directory names are also case-sensitive.
Files contd..
- File extensions eg., .txt or .jpg or .doc etc. have no relevance in UNIX.
- It is good practice for users to use a file extension that describes the file type.
- Use long descriptive names for your files. File name length is allowed up to 255 characters.
- File size limits are defined by the file system used by the OS.
- Current file systems support file sizes larger than the capacity of current hardware ( ^ bytes).
File paths
- In a shell you are always in a particular location. Default location after login is your home - Eg: /home/kvarala
- Every file has a location on the server.
- Path defines the location of the file/directory.
- Path can be defined two ways:
- Absolute: Path starts from Root. Eg., /scratch/scholar/k/kvarala/Week1/Lecture_1.pdf
- Relative: Path starts from current location. Eg., ../Week2/Lecture_2.pdf
- Special characters: -. Means current directory
- .. Means parent directory
- ~ Means home directory
Commands
- Every command is a program.
- UNIX philosophy is write simple programs that
do one job very well.
- Complex functionality can be built by
combining simple programs.
- User can add commands by writing their own
program
- Commands are of course Case-sensitive and
the OS needs to know the path to the program.