22
ObjectivesObjectives
Define operating systems in general and the Define operating systems in general and the UNIX operating system in particularUNIX operating system in particular
Describe Linux as it relates to UNIXDescribe Linux as it relates to UNIX
Explain the function of UNIX shellsExplain the function of UNIX shells
Describe the options for connecting to a UNIX Describe the options for connecting to a UNIX systemsystem
Define the syntax used for entering UNIX Define the syntax used for entering UNIX commandscommands
33
Objectives (cont.)Objectives (cont.)
Use the date, cal, who, man, whatis, and clear Use the date, cal, who, man, whatis, and clear commandscommands
Perform basic command-line editing operationsPerform basic command-line editing operations
Enter multiple commands on a single command Enter multiple commands on a single command lineline
Recall a command from the command historyRecall a command from the command history
Log in to and log out of UNIXLog in to and log out of UNIX
44
Understanding Operating Understanding Operating SystemsSystems
Operating System (OS)Operating System (OS)– The most fundamental computer programThe most fundamental computer program– Enables you to store information, process raw Enables you to store information, process raw
data, use application software, compile your data, use application software, compile your own programs, and access attached own programs, and access attached hardware, such as a printer or keyboardhardware, such as a printer or keyboard
UNIX Operating SystemUNIX Operating System– Leading OS for workstations, which are Leading OS for workstations, which are
computers on a local area network (LAN)computers on a local area network (LAN)
66
PC Operating SystemsPC Operating SystemsA personal computer (PC) OS conducts all the input, output, A personal computer (PC) OS conducts all the input, output, processing, and storage operations on a stand-alone computerprocessing, and storage operations on a stand-alone computer
77
Mainframe Operating SystemsMainframe Operating SystemsA mainframe OS controls a large computer system with multiple A mainframe OS controls a large computer system with multiple processors that conduct input, output, processing, and storage processors that conduct input, output, processing, and storage operations for many usersoperations for many users
88
Network Operating SystemsNetwork Operating SystemsA network OS controls the operations of a server computer, A network OS controls the operations of a server computer, sometimes called a host, which accepts requests from user sometimes called a host, which accepts requests from user programs running on other computers, called clientsprograms running on other computers, called clients
99
Server-based vs. peer-to-peer Server-based vs. peer-to-peer networks networks
Server-based networkServer-based network– Centralized processing approachCentralized processing approach– Data and applications server residentData and applications server resident– If server fails, entire network failsIf server fails, entire network fails
Peer-to-peerPeer-to-peer– Distributed processing approachDistributed processing approach– Data and applications workstation residentData and applications workstation resident– Each system is both a server and a clientEach system is both a server and a client
1010
Introducing the UNIXIntroducing the UNIXOperating SystemOperating System
UNIX can be used on systems functioning UNIX can be used on systems functioning as:as:– Dedicated servers or client workstations in a Dedicated servers or client workstations in a
server-based networkserver-based network– Client/server workstations connected to a Client/server workstations connected to a
peer-to-peer networkpeer-to-peer network– Stand-alone workstations not connected to a Stand-alone workstations not connected to a
networknetwork
1111
Introducing the UNIXIntroducing the UNIXOperating SystemOperating System
UNIX is a multi-user systemUNIX is a multi-user system– Allows many users access and share the Allows many users access and share the
resources of a server computerresources of a server computer
UNIX is a multitasking systemUNIX is a multitasking system– Allows user to execute more than one Allows user to execute more than one
program at a timeprogram at a time
UNIX is a portable operating systemUNIX is a portable operating system– Used in many computing environmentsUsed in many computing environments
1212
UNIX ConceptsUNIX Concepts
ShellShell– The interface between user and OSThe interface between user and OS
Hierarchical StructureHierarchical Structure– Directory and subdirectory organizationDirectory and subdirectory organization
Layered componentsLayered components– Layers of software surround the computer’s Layers of software surround the computer’s
inner coreinner core
1414
Linux and UNIXLinux and UNIX
Linux is UNIX-likeLinux is UNIX-like– Not written from traditional UNIX codeNot written from traditional UNIX code
Linux is original codeLinux is original code– Includes POSIX standardsIncludes POSIX standards
Other Linux informationOther Linux information– Created by Linus TorvaldsCreated by Linus Torvalds– Offers all the complexity of UNIXOffers all the complexity of UNIX– Linux can coexist with other OSsLinux can coexist with other OSs
1515
Introducing UNIX ShellsIntroducing UNIX Shells
A shell is a UNIX A shell is a UNIX program that program that interprets the interprets the commands you commands you enter from the enter from the keyboardkeyboard
1616
Choosing Your ShellChoosing Your Shell
Shells interpret commands and act as first-class Shells interpret commands and act as first-class programming languagesprogramming languages
A default shell is associated with your account A default shell is associated with your account when created – Bash is the default shell in Linuxwhen created – Bash is the default shell in Linux
A list of some UNIX shells:A list of some UNIX shells:– BourneBourne– KornKorn– C shellC shell– BashBash
1717
Choosing User Names Choosing User Names and Passwordsand Passwords
To use UNIX, a user must log in by providing a To use UNIX, a user must log in by providing a unique user name and passwordunique user name and password
UNIX system administrators create accounts by UNIX system administrators create accounts by adding user names and passwordsadding user names and passwords
Users log in to UNIX or Linux systems as long Users log in to UNIX or Linux systems as long as they have accounts on the workstation or as they have accounts on the workstation or host (server) computerhost (server) computer
1818
Connecting to a UNIX SystemConnecting to a UNIX System
Remotely through TelnetRemotely through Telnet
Through network client softwareThrough network client software
As peer on peer-to-peer networkAs peer on peer-to-peer network
On a stand-alone PCOn a stand-alone PC
Through a dumb terminalThrough a dumb terminal
1919
Connecting to UNIXConnecting to UNIXUsing TelnetUsing Telnet
Telnet is terminal emulation softwareTelnet is terminal emulation software– Connects your PC to a server, or hostConnects your PC to a server, or host
PC could be running UNIX, Linux, PC could be running UNIX, Linux, Windows OS, or Macintosh OSWindows OS, or Macintosh OSOnce connected to a UNIX host, work Once connected to a UNIX host, work with UNIX may beginwith UNIX may begin
– Uses IP addresses or domain names Uses IP addresses or domain names to access remote systemsto access remote systems
2020
Logging in to UNIXLogging in to UNIX
Log in by entering username and password Log in by entering username and password when UNIX system booted or connected towhen UNIX system booted or connected to
Enter at prompt (command-line mode) or into Enter at prompt (command-line mode) or into login box (GUI mode)login box (GUI mode)
Now commands can be issued at the Now commands can be issued at the command promptcommand prompt
2121
Logging In to UNIXLogging In to UNIX
Telnet is accessed in Telnet is accessed in Red Hat Linux using Red Hat Linux using the GNOME interfacethe GNOME interface
2222
Entering CommandsEntering Commands
To interact with UNIX, a command is entered To interact with UNIX, a command is entered at the command promptat the command prompt
UNIX is case-sensitive and most commands UNIX is case-sensitive and most commands are typed in lower caseare typed in lower case
Two categories of commandsTwo categories of commands– User-level: perform tasksUser-level: perform tasks– System administration: system managementSystem administration: system management
2323
Entering CommandsEntering Commands
The date commandThe date command– Displays the system date, which the system Displays the system date, which the system
administrator maintainsadministrator maintains
The cal commandThe cal command– Shows the system calendarShows the system calendar
The who commandThe who command– Shows who is using the system and their Shows who is using the system and their
current locationcurrent location
2727
Entering CommandsEntering Commands
Command-line editingCommand-line editing– Certain keystrokes perform command-line Certain keystrokes perform command-line
editing (shell dependent)editing (shell dependent)
Multiple command entryMultiple command entry– More than one command on one line by More than one command on one line by
separating with a semicolon(;)separating with a semicolon(;)
The clear commandThe clear command– Clears the current screenClears the current screen
2828
Entering CommandsEntering Commands
Command-line historyCommand-line history– Use up and down arrow keys to scroll Use up and down arrow keys to scroll
through command historythrough command history
The whatis commandThe whatis command– Displays a brief description of a command Displays a brief description of a command
for help purposesfor help purposes
2929
Entering CommandsEntering Commands
The man program The man program displays the UNIX displays the UNIX online reference online reference manual, called the manual, called the man pages, for man pages, for help purposeshelp purposes
3030
Logging Out of UNIXLogging Out of UNIX
Logging out ends your current process Logging out ends your current process and indicates to UNIX that you are and indicates to UNIX that you are finishedfinished
Logging out is shell dependentLogging out is shell dependent– Bourne, Korn, Bash – exit commandBourne, Korn, Bash – exit command– C shell – logout commandC shell – logout command
3131
Understanding the Role of the Understanding the Role of the UNIX System AdministratorUNIX System Administrator
System administrator manages the UNIX System administrator manages the UNIX systemsystem– Adds users and deletes old accountsAdds users and deletes old accounts– Also called the superuserAlso called the superuser– Unlimited permission to alter systemUnlimited permission to alter system– Unique user name: rootUnique user name: root– Prompt ends with # (pound) symbolPrompt ends with # (pound) symbol
3232
Changing PasswordsChanging Passwords
For security purposes, changing For security purposes, changing passwords is necessarypasswords is necessary– Use the passwd commandUse the passwd command– UNIX allows new password if:UNIX allows new password if:
The new password differs by at least three The new password differs by at least three characterscharactersIt has six or more characters, including at least It has six or more characters, including at least two letters and one numbertwo letters and one numberIt is different from the user nameIt is different from the user name
3333
Viewing Files Using theViewing Files Using thecat, more, less, head, and tail cat, more, less, head, and tail
CommandsCommands
Use cat, more, and less to view an entire Use cat, more, and less to view an entire file contentsfile contents– cat displays a whole file at one timecat displays a whole file at one time– more displays a file one screen at a time, more displays a file one screen at a time,
allowing scroll down allowing scroll down
– less displays a file one screen at a time, less displays a file one screen at a time, allowing scroll down and upallowing scroll down and up
3434
Viewing Files Using theViewing Files Using thecat, more, less, head, and tail cat, more, less, head, and tail
CommandsCommands
Use head and tail to view the first few or Use head and tail to view the first few or last few lines of a filelast few lines of a file– head displays the first few lineshead displays the first few lines– tail displays the last few linestail displays the last few lines
3535
Redirecting OutputRedirecting Output
The greater than sign (>) is called a The greater than sign (>) is called a redirection symbolredirection symbol
Create a new file or overwrite an existing Create a new file or overwrite an existing file by attaching (>) to a command that file by attaching (>) to a command that produces outputproduces output
To append to an existing file, use two To append to an existing file, use two redirection symbols (>>)redirection symbols (>>)
3636
Chapter SummaryChapter Summary
The operating system controls all computer The operating system controls all computer resources and provides the base upon which resources and provides the base upon which application programs can be used or writtenapplication programs can be used or written
A server-based network is centralized where A server-based network is centralized where security and maintenance are handled by the security and maintenance are handled by the system administrator and all systems rely on system administrator and all systems rely on the server; a peer-to-peer network is the server; a peer-to-peer network is decentralized where security and maintenance decentralized where security and maintenance is distributed to each system and if one of the is distributed to each system and if one of the systems fails, the network continues to functionsystems fails, the network continues to function
3737
Chapter SummaryChapter Summary
UNIX is a multi-user, multitasking UNIX is a multi-user, multitasking operating systemoperating system
UNIX systems may be configured as UNIX systems may be configured as servers or as client workstations in a servers or as client workstations in a server-based network, as client/server server-based network, as client/server workstations in a peer-to-peer network, workstations in a peer-to-peer network, or stand-alone workstations when no or stand-alone workstations when no network connection network connection
3838
Chapter SummaryChapter Summary
The concept of the layered components that The concept of the layered components that make up an OS originated with UNIXmake up an OS originated with UNIX
Linux is a UNIX-like OS and can coexist with Linux is a UNIX-like OS and can coexist with Windows and MS-DOSWindows and MS-DOS
In UNIX, you communicate with the OS In UNIX, you communicate with the OS programs through an interpreter called the programs through an interpreter called the shell and UNIX provides shells such as the shell and UNIX provides shells such as the Bourne, Korn, and C shells, with Bash being Bourne, Korn, and C shells, with Bash being the most popular on Linux systemsthe most popular on Linux systems
3939
Chapter SummaryChapter Summary
In UNIX, the system administrator sets up In UNIX, the system administrator sets up accounts for users that supply a username and accounts for users that supply a username and passwordpassword
You work with UNIX by typing commands that You work with UNIX by typing commands that you can learn by referring to the online manual you can learn by referring to the online manual called man pages; commands have specific called man pages; commands have specific syntax and allow you to see brief descriptions syntax and allow you to see brief descriptions of commands, see who is logged in, display the of commands, see who is logged in, display the system calendar, and log outsystem calendar, and log out
4040
Chapter SummaryChapter Summary
Most shells provide basic command-line Most shells provide basic command-line editing capabilities and keep a history of editing capabilities and keep a history of your most recently used commandsyour most recently used commands
You can view the contents of files with You can view the contents of files with view commands such as cat, less, more, view commands such as cat, less, more, head, and tailshead, and tails