Sei sulla pagina 1di 25

Introduction to UNIX

University of Pittsburgh
What is UNIX?
¾ Operating system (OS) for mainframe computers
– allows user to communicate with hardware of computer
– similar to DOS, Windows and Macintosh OS on PC’s
– most PC’s in labs don’t run UNIX but communicate with Pitt’s
mainframes that do
¾ Multitasking/Time Sharing
– multitasking : run more than 1 program at a time (foreground or
background)
– time sharing : switching back and forth between open tasks

University of Pittsburgh
What is UNIX? cont.
¾ Multiuser
– PC - one person using OS at a time
– mainframe - hundreds of users at one time running multiple applications
¾ File transfer/storage
– transferring files from PC to mainframe for storage
¾ UNIX
– very powerful, extensive
– we will learn how to use UNIX in general and how to find help on utilizing
specific functions

University of Pittsburgh
UNIX Components
¾ Kernel
– master control of all computer operations
– controls access to files, allocates resources, controls
input/output, manages memory
¾ Shell
– command interpreter - transfers information between user and
the Kernel
– common shells : “C” shell, Bourne Shell, Korn Shell
– shell uses prompt (% or $) to indicate readiness to accept next
command

University of Pittsburgh
UNIX Components cont.
¾ Shell functions:
– displays prompt on screen
– as user types shell reads characters and displays on screen
– when user hits “return, shell attempts to interpret command
– if it can’t interpret shell gives error message
– if command is interpreted shell sends signal to Kernel to
execute command
– when execution complete shell displays prompt awaiting next
command

University of Pittsburgh
UNIX Components cont.
¾ File System
– files contain different types of data created by user or computer
– files stored in user’s “user directory”
¾ Utilities
– commands or programs
– ex. editors, e-mail programs, database programs

University of Pittsburgh
Logon to Pitt UNIX

University of Pittsburgh
Logon to Pitt UNIX

University of Pittsburgh
Basic UNIX Commands
¾ man – provides access to the online UNIX manual
– ex. man ls will return more information about the UNIX command ls
¾ pwd – returns the name of the present working directory
¾ ls – will return a list of the contents of a directory
– ex. ls-l will return the long list option of contents
¾ mkdir – will make a new sub-directory in your pwd
– ex. mkdir hmwk
¾ rmdir – will remove a sub-directory in your pwd
– ex. rmdir hmwk

University of Pittsburgh
Basic UNIX Commands
¾ cd – will change the working directory
– ex. cd no argument – return to home directory
– ex. cd .. return you up 1 level
– ex. cd / will bring you to the root level
– ex. cd ../../../../lookout/a/fred/c changes directory to
specified path
¾ rm – removes file/s in pwd
– ex. rm ch1 will remove file ch1 in pwd
– ex. rm ch* will remove any file beginning with ch in pwd
– ex. rm * will remove all files in pwd
¾ cp – copies file/s from pwd to target destination
– ex. cp ch1 ../../projects/chapter1 will copy file ch1 in pwd
to directory projects and rename chapter1

University of Pittsburgh
Basic UNIX Commands
¾ mv – will move a file to a target directory
– ex. mv ~eric/chm/lab1/data ~ fred/c/proj1/newdata
– ex. mv../../../boreas/b/eric/chm/lab1/data
c/proj1/newdata
– ex.
mv../../../boreas/b/eric/chm/lab1/data .
¾ cal – prints a calender
¾ date – prints the week, date and time
¾ cat – displays the contents of a text file
¾ more - displays the contents of a text file one screen at a time
¾ spell & ispell – checks spelling in a text file

University of Pittsburgh
Basic UNIX Commands
¾ who – list users currently signed onto network
¾ who am i – will tell you who you are
¾ clear – clears the screen
¾ du –k – tells you your disk utilization
¾ passwd – allows you to change your password

University of Pittsburgh
PICO
¾ built-in text editing program
¾ Access by typing “pico” at $ prompt
¾ not very easy/intuitive to work with, better to generate
text files with a PC based text editor (word, wordpad,
notepad) and then transfer files into your UNIX account
via FTP program

University of Pittsburgh
The .plan file
¾ resides in the user’s home directory
¾ can be personalized to contain contact information etc.
¾ must be named .plan
¾ must be saved as a plain text format document
¾ is accessed by public using the “finger” command

University of Pittsburgh
UNIX File System
¾ Tree-like structure (upside-down) that keeps each of
thousands of users files separate and in order using
system of directories and subdirectories
¾ pathname: “directions” to a file through directories and
subdirectories
¾ root directory: very top of directory tree
– denoted with a “/”

University of Pittsburgh
Absolute and Relative Addressing
¾ Absolute:
– every file has 1 and only 1 absolute address
– usually starts with a “/” as first character
– starts at root directory and moves through directories/subdirectories to file
– can use “~” to start the path at the user level
¾ Relative:
– describe path to file from current working directory
– relative addresses not unique
– do not need to begin with a “/”

University of Pittsburgh
Relative Addressing cont.
¾ Single dot (.) used to signify current working directory
¾ double dot (..) used to describe parent (1 step up)
directory
¾ relative address starts at current level and moves through
subdirectories
¾ each step (directory/subdirectory)is separated by a “/”

University of Pittsburgh
File Names
¾ Up to 256 characters in length
¾ can start with/be all numbers
¾ can use period (.), underscore (_), dash (-) or comma (,)
¾ case sensitive (PC usually not)
¾ do not include spaces in file name

University of Pittsburgh
Wild Characters
¾ Characters that can be used to match a number of
different character combinations
¾ (?) - represents 1 character
– ex. Lab?.c could describe Lab3.c, Lab8.c, LabK.c
¾ (*) - represents more than 1 character
– ex. Lab*.c could describe Lab223.c, LabA1155.c

University of Pittsburgh
~

Absolute Address of file ex7.c: /home/lookout/a/fred/c/hmwks/ex7.c


Using “~” shortcut to “users” level: ~/c/hmwks/ex7.c

University of Pittsburgh
Relative Address: “.” = current directory
“..” = dir. 1 step up
“/” = separates steps

University of Pittsburgh
If your working dir. is linda, relative address of ex7.c is:
../../../lookout/a/fred/c/hmwks/ex7.c

University of Pittsburgh
Relative Address of fred to file “data”:
../../../boreas/b/eric/chm/lab1/data

University of Pittsburgh
FTPing with Telnet

University of Pittsburgh
FTPing with WS_FTP

http://www.ftpplanet.com/

University of Pittsburgh

Potrebbero piacerti anche