Chapter 15 unix and linux operating system s
Download
1 / 78

Chapter 15 UNIX and Linux Operating System s - PowerPoint PPT Presentation


  • 120 Views
  • Uploaded on

Chapter 15 UNIX and Linux Operating System s. Understanding Operating Systems, Fourth Edition. Objectives. You should be able to describe: The similarities between UNIX and Linux The design goals for both operating systems The significance of using files to manipulate devices

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about ' Chapter 15 UNIX and Linux Operating System s' - sanura


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Chapter 15 unix and linux operating system s

Chapter 15UNIX and Linux Operating Systems

Understanding Operating Systems, Fourth Edition


Objectives
Objectives

You should be able to describe:

  • The similarities between UNIX and Linux

  • The design goals for both operating systems

  • The significance of using files to manipulate devices

  • The differences between command-driven and menu-driven interfaces

  • The roles of the Memory, Device, and Processor Managers

Understanding Operating Systems, Fourth Edition


Overview
Overview

  • UNIX and Linux share three major advantages:

    • Portable from large systemsto small systems

      • Written in a high-level language, C

    • Powerful utilities

      • Brief, single-operation commands can be combined in a single command line to achieve any desired result

    • Device independent

      • Device drivers are included as part of the operating system, and not as part of devices

Understanding Operating Systems, Fourth Edition


Overview1
Overview

  • Disadvanatges:

    • No single standardized version of operating system in UNIX

    • Both have very brief, cryptic commands

      • Novice users find unfriendly

  • Both UNIX and Linux are case-sensitive and strongly oriented toward lower-case characters

Understanding Operating Systems, Fourth Edition


The evolution of unix
The Evolution of UNIX

Table 15.1: Evolution of UNIX

Understanding Operating Systems, Fourth Edition


The evolution of unix continued
The Evolution of UNIX (continued)

Table 15.1 (continued):Evolution of UNIX

Understanding Operating Systems, Fourth Edition


The evolution of unix continued1
The Evolution of UNIX (continued)

Table 15.1 (continued):Evolution of UNIX

Understanding Operating Systems, Fourth Edition


The evolution of unix continued2
The Evolution of UNIX (continued)

  • New releases of UNIX include following features:

    • Full support for local area networks

    • Complies with international operating system standards

    • Greatly improved system security

      • Meets many security requirements

    • Most feature Common Desktop Environment (CDE) which is a uniform GUI

  • Challenge: To standardize to improve portability of programs from one system to another

    • Release of ISO/IEC 9945:2003 is big step

Understanding Operating Systems, Fourth Edition


The evolution of linux
The Evolution of Linux

  • Linux is a contraction of Linus and UNIX

  • Based on a powerful multiplatform operating system, UNIX

  • Brought speed, efficiency,and flexibility of UNIX to PC environment

  • Linux is an open-source program

  • Has Windows-like graphical userinterfaces

Understanding Operating Systems, Fourth Edition


The evolution of linux continued
The Evolution of Linux (continued)

Table 15.2:Major releases ofLinux by Red Hat, Inc.

Understanding Operating Systems, Fourth Edition


The evolution of linux continued1
The Evolution of Linux (continued)

Table 15.2 (continued):Major releases ofLinux by Red Hat, Inc.

Understanding Operating Systems, Fourth Edition


The evolution of linux continued2
The Evolution of Linux (continued)

Table 15.2 (continued):Major releases ofLinux by Red Hat, Inc.

Understanding Operating Systems, Fourth Edition


Design goals
Design Goals

  • Linux and UNIX share similar design goals:

    • Develop an operating system that would supportsoftware development

      • Included utilities in OS for which programmers typically need to write code

      • Each utility designed for simplicity

      • Each utility designed to be used in combination with each other

    • Keep its algorithms as simple as possible

    • Make it portable

Understanding Operating Systems, Fourth Edition


Design goals continued
Design Goals (continued)

Table 15.3:Systemfunctions supported in Linux and UNIX

Understanding Operating Systems, Fourth Edition


Design goals continued1
Design Goals (continued)

Table 15.3 (continued):Systemfunctions supported in Linux and UNIX

Understanding Operating Systems, Fourth Edition


Unix memory management
UNIX Memory Management

  • Uses following memory management techniques:

    • Swapping (for small jobs)

    • Demand paging (for large jobs)

  • Typical internal memory layout consists of:

    • Program code

    • Data segment

    • Stack

Understanding Operating Systems, Fourth Edition


Unix memory management continued
UNIX Memory Management (continued)

Figure 15.1:Typical internal memory layout for single user-memory partUNIX image

Understanding Operating Systems, Fourth Edition


Unix memory management continued1
UNIX Memory Management (continued)

  • Program code:

    • Sharable portion of program

    • Written in reentrant code as physically shared by several processes

    • Protected so that its instructions aren’t modified in any way during normal execution

    • Space allocated to program code can’t be released until all processes using it have completed execution

    • UNIX uses text table to keep track of which processes are using which program code

Understanding Operating Systems, Fourth Edition


Unix memory management continued2
UNIX Memory Management (continued)

  • Data Segment:

    • Starts after program code and grows towardhigher memory locations

    • Nonsharable section of memory

  • Stack:

    • Starts athighest memory address and grows downward as subroutine calls and interruptsadd information to it

    • Section of main memory where process informationis saved when process is interrupted

    • Nonsharable section ofmemory

Understanding Operating Systems, Fourth Edition


Unix memory management continued3
UNIX Memory Management (continued)

  • Unix Kernel:

    • Part of OS that implements “system calls” to set up memory boundaries

    • Set of programs that implements most primitive of that system’s functions

    • Permanently reside in memory

    • UNIX uses LRU page replacement algorithm

  • Same memory management concepts are used for network PCs, single-user and multi-user systems

Understanding Operating Systems, Fourth Edition


Linux memory management
Linux Memory Management

  • Allocates memory space to each process

    • e.g., In Intel X86, Linux allocates 1 GB of high ordermemory to kernel and 3 GB of memory to executing processes

  • Address spaceis divided among:

    • Process code

    • Process data

    • Code and shared library data used by process

    • Stack used by process

Understanding Operating Systems, Fourth Edition


Linux memory management continued
Linux Memory Management (continued)

  • Linux has system calls that change size of process data segment as required

  • Offers memory protection based on type of information stored

  • When kernel needs memory space, pages are released using LRU algorithm

  • Maintains a dynamically managed area in memory, a page cache

Understanding Operating Systems, Fourth Edition


Linux memory management continued1
Linux Memory Management (continued)

  • If any pages marked for deletion have been modified, they’re rewritten to disk

    • Page corresponding to file mapped into memory is rewrittento file

    • Page corresponding to data is saved on swap device

  • Linux uses system of page table to keep track of free and busy pages

  • Uses virtual memory mechanism

Understanding Operating Systems, Fourth Edition


Processor management
Processor Management

  • Processor Manager of UNIX system kernel handles:

    • Allocation of CPU

    • Process scheduling

    • Satisfaction of process requests

  • Process scheduling algorithm picks process with highest priority to be runfirst

    • Any processes that have used a lot of CPU time will get lower priority than those thathave not

  • System updates compute-to-total-time ratio for each job everysecond

Understanding Operating Systems, Fourth Edition


Processor management continued
Processor Management (continued)

  • If several processes have same computed priority,they’re handled round-robin

  • Process with longest timespent on secondary storage will be loaded first from READY queue

  • Process either waiting for disk I/O or currently idle is temporarily moved out to makeroom for new arrival

  • UNIX dynamically recalculates all process priorities to determinewhich inactive but ready process will begin execution when processor becomesavailable

Understanding Operating Systems, Fourth Edition


Process table versus user table
Process Table Versus User Table

  • UNIX uses several tables to keep system running smoothly

  • Information on simple processes, those with nonsharable code, is stored in twosets of tables:

    • Process table:

      • Always resides in memory

    • User table:

      • Resides in memory only while process is active

      • User table, together with process data segment and code segment, can be swapped into or out of main memory as needed

Understanding Operating Systems, Fourth Edition


Process table versus user table continued
Process Table Versus User Table (continued)

Figure 15.2:Process control structureshowing how process table and texttable interact forprocesses with sharablecode, as well as for thosewithout sharable code

Understanding Operating Systems, Fourth Edition


Process table versus user table continued1
Process Table Versus User Table (continued)

Process Table:

  • Each entry contains following information:

    • Process identificationnumber

    • User identification number

    • Process memory address or secondary storageaddress

    • Size of process and scheduling information

  • Process table is set up when process is created and is deleted when process terminates

Understanding Operating Systems, Fourth Edition


Process table versus user table continued2
Process Table Versus User Table (continued)

Text Table:

  • For processes with sharable code, process table maintains a text table, which contains:

    • Memory address or secondarystorage address of the text segment (sharable code)

    • A count to keep track of number of processes using this code

      • Increased by one when process starts using code

      • Decreased by one when process stops using code

      • Count = 0 implies code is no longer needed

Understanding Operating Systems, Fourth Edition


Process table versus user table continued3
Process Table Versus User Table (continued)

User Table:

  • Allocated to each active process

  • Kept in transient area of memory

  • Contains following information that must be accessible when process is running:

    • User and group identification numbers to determine file access privileges

    • Pointers to system’s file table for every file being used by the process

    • A pointer to current directory

    • A list of responses for various interrupts

Understanding Operating Systems, Fourth Edition


Synchronization
Synchronization

  • UNIX is true multitasking operating system

  • Achieves process synchronization byrequiring that processes wait for certain events

  • Each event is represented by integers equal to address oftable associated with event

  • A race may occur if event happens during process’s transition between decidingto wait for event and entering WAIT state

Understanding Operating Systems, Fourth Edition


fork

  • fork:Capability of executing oneprogram from another program

    • Gives secondprogram all attributes of first program, such as any open files, and savesfirst program in its original form

    • Splits program into two copies, which are both running from statement after fork command

    • When fork is executed “process id” (pid) generated

      • Ensures each process has own unique ID number

Understanding Operating Systems, Fourth Edition


Fork continued
fork (continued)

Figure 15.3:When fork commandis received, parentprocess shown in (a)begets child processshown in (b) andStatement 2 is executedtwice

Understanding Operating Systems, Fourth Edition


wait

  • wait: Allows programmer to synchronize process execution by suspending parent until child is finished

    • In a program, the IF-THEN-ELSE structure is controlled by value assigned to pid:

      • pid > 0: parent process,

      • pid = 0: child process

      • pid < 0: error in fork call

Understanding Operating Systems, Fourth Edition


Wait continued
wait (continued)

Figure 15.4: wait command usedin conjunction with fork command synchronizes parent andchild processes. (a) shows parentprocess, (b) shows parent and child after fork, and (c) shows parent and child duringwait

Understanding Operating Systems, Fourth Edition


exec

  • exec: Used to start execution of new program from another program, e.g., execl, execv, execls, execlp and execvp

    • Successful exec call will overlay second program over first, leaving only second program in memory

    • No return from successful exec call

      • Concept of parent-child doesn’t hold here

    • Each exec call is followed by test to ensure successful completion

Understanding Operating Systems, Fourth Edition


Exec continued
exec (continued)

Figure 15.5: exec command is used after fork and wait combination. (a) shows parent before fork, (b) shows parent and child after fork, and (c) shows how the child process (Process 2) is overlaid by the ls program after the exec command

Understanding Operating Systems, Fourth Edition


Linux process management
Linux Process Management

  • Linux supports the concept of “personality” to allow processes coming from otheroperating systems to be executed

    • Each process is assigned to anexecution domain specifying the way in which

      • System calls are carried out

      • Messages are sent to processes

  • Supports pipes to allow executing processes to exchange data

  • Has an extension, which permits process “clones” to be created

Understanding Operating Systems, Fourth Edition


Linux process management continued
Linux Process Management (continued)

  • Clone process is created using primitive “clone,” by duplicating its parentprocess

    • Allows both processes to share same segment ofcode and data

    • Modification of one is visible to other, which is unlike classicalprocesses

  • Ability to clone processes brings possibility of implementing serversin which several threads may be executing

Understanding Operating Systems, Fourth Edition


Organization of table of processes
Organization of Table of Processes

  • Each process is referenced by descriptor

    • Describes process attributes together with information needed to manage process

  • Kernel dynamically allocates these descriptors when processes begin execution

  • All process descriptors are organized in doubly linked list

  • Scheduler used Macro instructions to manage and update process descriptor lists as needed

Understanding Operating Systems, Fourth Edition


Process synchronization
Process Synchronization

  • To allow two processes to synchronizewith each other, Linux provides:

    • Wait queue: Linked circular list of process descriptors

    • Semaphores: Used to solve problems of mutual exclusion and problems of producers and consumers

      • In Linux they contain three fields:

        • Semaphore counter

        • Number of waiting processes

        • List of processes waiting for semaphore

Understanding Operating Systems, Fourth Edition


Device management
Device Management

  • UNIX and Linux aretruly device independent

  • Both treateach I/O deviceas special type of file

  • Device files are given “descriptors”

    • Identify devices, contain information about them, and are stored in device directory

  • Device drivers:

    • Written in C

    • Part of the kernel

  • Both come with device drivers to operate the most commonperipheral devices

Understanding Operating Systems, Fourth Edition


Device management continued
Device Management (continued)

  • Actual incorporation of device driver into kernel is done during systemconfiguration

  • Recent versions of UNIX have program called config that automatically createsconf.c file for any given hardware configuration

    • Contains parameters that control resources such as number of internal bufferfor kernel and size of swap space

    • Contains twotables:

      • bdevsw (short for “block I/O devices”)

      • cdevsw (short for “character I/Odevices

Understanding Operating Systems, Fourth Edition


Device classifications
Device Classifications

  • Both UNIX and Linux divide I/O system into:

    • “Block I/O” system (“structured I/O” system)

    • “Character I/O” system (“unstructured I/O” system)

  • Each physical device is identified by:

    • A minor device number

    • A major device number

    • A class—either block or character

      • Each has a Configuration Table that contains an array of entry points intodevice drivers

Understanding Operating Systems, Fourth Edition


Device classifications continued
Device Classifications (continued)

Figure 15.6:The hierarchy of I/O devicesin UNIX and Linux

Understanding Operating Systems, Fourth Edition


Device classifications continued1
Device Classifications (continued)

  • Major device number: Used as index to array to access appropriate code for specific device driver

  • Minor device number: Passed to device driver as argument and is used to access one of several identical physical devices

  • Block I/O system: Used for devices that can be addressed as sequence of 512-byte blocks

    • Allows Device Manager to use buffering to reduce I/O traffic

Understanding Operating Systems, Fourth Edition


Device classifications continued2
Device Classifications (continued)

  • Devices in character class are handled by device drivers that implement characterlists

    • Example: A terminal is typical character device that has two input queues and one outputqueue

  • I/O procedure is synchronized through hardware completion interrupts

  • Some devices can actually belong to both classes: block and character

    • Example: Disk drives and tape drives

Understanding Operating Systems, Fourth Edition


Device drivers
Device Drivers

  • Special section in kernel, which includes all the instructions necessary for OS tocommunicate with device

  • Device drivers for disk drives use a seek strategy tominimize the arm movement

  • Kept in a set of files:

    • Can be loaded as needed, in case of seldomused devices

    • Can be kept in memory all the time when operating systemboots

    • Kept in /dev directory by default and convention

Understanding Operating Systems, Fourth Edition


File management
File Management

  • UNIX has three types of files and each file enjoys certain privileges:

    • Directories

    • Ordinary files

    • Special files

  • Directories:

    • Used by system to maintain hierarchical structure of file system

    • Users are allowed to read information in directory files

    • Only system is allowed to modify directory files

Understanding Operating Systems, Fourth Edition


File management continued
File Management (continued)

  • Ordinary files: Files in which users store information

    • Protection is based onuser’s requests

    • Related to read, write, execute, and delete functions that canbe performed on a file

  • Special files:Device drivers that provide interface to I/O hardware

    • Appear as entries in directories

    • Part of file system, and most of themreside in /dev directory

    • Name of each special file indicates type of devicewith which it’s associated

Understanding Operating Systems, Fourth Edition


File management continued1
File Management (continued)

  • UNIX stores files as sequences of bytes and doesn’t impose any structure on them

    • Text files are strings of characters with linesdelimited by line feed, or new line, character

    • Binary files are sequences of binarydigits grouped into words as they will appear in memory during program execution

  • Structure of files is controlled by programs that use them,not by system

Understanding Operating Systems, Fourth Edition


File management continued2
File Management (continued)

  • UNIX file management system organizes disk into blocks of 512 bytes each

  • Divides disk into four basic regions:

    • First region (address 0) reservedfor booting

    • Second region contains size of disk and boundaries ofother regions

    • Third region includes list of file definitions, “i-list,”

    • Remaining region holds free blocks availablefor file storage

  • Whenever possible files are stored in contiguous empty blocks

Understanding Operating Systems, Fourth Edition


File management continued3
File Management (continued)

i-node:

  • Each entry in the i-list is called an “i-node” (or inode) and contains 13 disk addresses

  • Each contains the following information on a specific file:

    • Owner’s identification

    • Protection bits, physical address, file size

    • Time of creation, last use and last update

    • Number of links

    • If file is directory, ordinary file, or special file

Understanding Operating Systems, Fourth Edition


Filenames in unix and linux
Filenames in UNIX and Linux

  • Filenames are case sensitive

  • Linux and most versions of UNIX allow filenames to be of unlimited length

    • Older versions of UNIX have maximum of 14 characters including any suffixes and period

  • OSs don’t impose any naming conventions on files

    • Some compilers expect files to have specific suffixes

  • Linux and UNIX support hierarchical tree file structure

    • Root directory is identified by slash (/)

Understanding Operating Systems, Fourth Edition


Filenames in unix and linux continued
Filenames in UNIX and Linux (continued)

Figure 15.7:File hierarchy with ( / )as root, directoriesas branches, and files as leaves

Understanding Operating Systems, Fourth Edition


Filenames in unix and linux continued1
Filenames in UNIX and Linux (continued)

  • Rules that apply to all path names:

    • If path name starts with slash, path starts at root directory

    • Path name can be either one name or list of names separated by slashes

      • Last name on list is name of file requested

    • Using two periods (..) in path name will move you upward in hierarchy(closer to root)

      • Only way to go up hierarchy; all other pathnames go down tree

    • Spaces are not allowed within path names

Understanding Operating Systems, Fourth Edition


Directories in unix and linux
Directories in UNIX and Linux

Table 15.4:Listof files stored in the directoryjournal from thesystem illustrated inFigure 15.7. The commandls -l (short for“listing-long”) was usedto generate this list

Understanding Operating Systems, Fourth Edition


Directories in unix and linux continued
Directories in UNIX and Linux (continued)

  • “long listing” of files in a directory shows eight pieces of informationfor each file

  • First column shows the type of file and the access privileges for each file:

    • Firstcharacter describes nature of file or directory

    • Next three characters show access privileges granted to owner of file

    • Next three characters describe access privileges granted to othermembers of user’s group

    • Last three characters describe access privileges grantedto users at large, those system-wide

Understanding Operating Systems, Fourth Edition


Directories in unix and linux continued1
Directories in UNIX and Linux (continued)

  • Second column in the directory listing indicates the number of links (number of aliases) that refer to the same physical file

  • Aliases are an importantfeature of UNIX

    • Support file sharing when several users work together on thesame project

    • Make it convenient for the shared files to appear in different directoriesbelonging to different users

    • Filename may be different fromdirectory to directory

    • Eventually this number will indicate when the file is no longer needed and canbe deleted

Understanding Operating Systems, Fourth Edition


Data structures in unix
Data Structures in UNIX

  • UNIX dividesthe file descriptors into parts

    • Hierarchical directories containing only thename of the file and the “i-number,” which is a pointer to another location, the“i-node,”

    • i-node contains the rest of the information

  • All i-nodes are stored in a reserved part of the device where the directory resides

  • Each i-node has room for 13 pointers (0–12)

Understanding Operating Systems, Fourth Edition


Data structures in unix continued
Data Structures in UNIX (continued)

Figure 15.8:Hierarchy fordirectories, i-nodes, andfile blocks

Understanding Operating Systems, Fourth Edition


Data structures in unix continued1
Data Structures in UNIX (continued)

  • When a file is opened

    • Its device, i-number, and read/write pointer are stored in thesystem file tableand indexed by the i-node

  • When a file is created

    • An i-node is allocated to it

    • A directory entry with filename and its i-node number is created

Understanding Operating Systems, Fourth Edition


Data structures in unix continued2
Data Structures in UNIX (continued)

  • When a file is linked

    • A directory entry is created with the new name

    • Original i-node number, and the link-count field in the i-node is incremented by one

  • When a shared file is deleted

    • Link-count field in the i-node is decremented by one

    • When the count reaches zero, the directory entry is erased and all disk blocks allocated to the file, along with its i-node block, are deallocated

Understanding Operating Systems, Fourth Edition


User interface
User Interface

  • UNIX and Linux are command-driven systems and many user commands are virtually identical

  • User commands:

    • Are very short, either one character or a group of characters (acronym of words making command)

    • Can’t be abbreviated or spelled out

    • Must be in the correct case

  • System prompt is very economical

    • Only one character, e.g., ($) or (%)

  • Error messages are also quite brief

Understanding Operating Systems, Fourth Edition


User interface continued
User Interface (continued)

Table 15.5A: User commands

Understanding Operating Systems, Fourth Edition


User interface continued1
User Interface (continued)

Table 15.5B:User commands

Understanding Operating Systems, Fourth Edition


User interface continued2
User Interface (continued)

  • General syntax of commands:

    command arguments file_name

    • “command” is any legal operating system command

      • interpreted and executed by the shell

    • “arguments” arerequired for some commands and optional for others

    • “file_name” can be arelative or absolute path name

Understanding Operating Systems, Fourth Edition


Script files
Script Files

  • Command files, often called shell files or script files, can be used to automate repetitioustasks

  • Each line of the file is a valid instruction and can be executed by typing sh and name of script file

  • Can also be executedbedefining the file as an executable command and typing filename at the systemprompt

  • The default shell for Linux is called bash (for Bourne Again Shell)

    • Other common shells: csh, and ksh

Understanding Operating Systems, Fourth Edition


Script files continued
Script Files (continued)

  • Example of a script file:

    setenv DBPATH /u/lumber:.:/zdlf/product/central/db

    setenv TERMCAP $INFODIR/etc/termcap

    stty erase `^H’

    set savehistory

    set history=20

    alias h history

    alias 4gen infogen -f

    setenv PATH /usr/info/bin:/etc

Understanding Operating Systems, Fourth Edition


Redirection
Redirection

  • Used to send output to a file or to another device

    • Symbol: >(between command and destination)

    • Examples: ls > myfiles

      cat chapt1 chapt2 > sectiona

      cat chapt* > sectiona

  • Symbol >> appends new file to an existing file

    • Examples: cat chapt1 chapt2 >> sectiona

      cat chapt* >> sectiona

  • Reverse redirection (<) takes input for a program from an existing file instead offrom keyboard

    • Example:mail ann roger < memo

Understanding Operating Systems, Fourth Edition


Redirection continued
Redirection (continued)

  • Redirection is combined with system commands to achieve any desired results:

    • Example:who > temporary (will store in filenamed “temporary” the names of all users logged on to system)

  • Interpretation of < and > is done by the shell and not by the individual program

  • Input and output redirection can be used with any program

Understanding Operating Systems, Fourth Edition


Pipes
Pipes

  • Pipes and filters make it possible to redirect output or input to selected files or devices

  • Pipe can connect output from one program to input of another without the need for temporary or intermediate files

    • Example: who | sort

  • A pipeline is several programs simultaneously processing the same I/O stream

    • Example: who | sort | lpr

Understanding Operating Systems, Fourth Edition


Filters
Filters

  • Programs that read some input, manipulate it in someway, and generate output

    • wc (word count): e.g., wc journal

      • System would respond with: 10 140 700, meaning that the file journalhas 10 lines, 140 words, and 700 characters

    • sort: Contents of the file are sorted anddisplayed on the screen

      • Example: sort sortednames

Understanding Operating Systems, Fourth Edition


Filters continued
Filters (continued)

  • To sort the list in alphabetical order but ignore the case of letters:

    sort -f sortednames

  • To obtain a numerical sort in ascending order:

    sort -n sortednums

  • To obtain a numerical sort in descending order:

    sort -nr sortednums

Understanding Operating Systems, Fourth Edition


Additional commands
Additional Commands

  • man: displays online manual supplied with the operating system

    • man cmp (displays the page for the compare (cmp) command)

  • grep: stands for “global regular expression and print”, looks for specific patterns of characters

    • Examples: grep Pittsburgh maillist

      grep -v Pittsburgh maillist

      grep -c Pittsburgh maillist

Understanding Operating Systems, Fourth Edition


Additional commands continued
Additional Commands (continued)

  • grep can be combined with who command.

    • e.g., who | grep sam (displays Sam’s name, device, and the date and time he logged in)

    • ls -l / | grep '^d‘ (displays list of all subdirectories (but not the files) found in the root directory)

  • nohup: Allows logging off the system without having to wait for program to finish

    • e.g., nohup cp oldlargefile newlargefile &

  • nice: Allows lowering the priority of a program

    • e.g., nice cp oldlargefile newlargefile &

Understanding Operating Systems, Fourth Edition


Summary
Summary

  • UNIX and Linux were written by programmers for programmers

  • Both are quite popular among those fluent in the ways of programming

  • Their advantages include spare user interface, device independence, portability, lack of verbosity, and powerful combinations of commands

  • Versions of UNIX can operate very large multiuser systems, single-user systems, and every size in between

Understanding Operating Systems, Fourth Edition


Summary continued
Summary (continued)

  • Linux is being adopted widely for single-user and enterprise-wide computing systems

  • Linux is characterized by its power, flexibility, and constant maintenance

  • Linux applies all the features of UNIX, including multitasking and multiuser capabilities, to desktop computers

  • Both operating systems are expected to increase in use and popularity for many years to come

Understanding Operating Systems, Fourth Edition


ad