What is an Operating System?
An operating system is a program that provides an interface between:
Examples of Operating Systems
What is Unix?
Files & Directories
Unix files and directories are very much like files and directories (folders) in Windows and MacOS.
All commands must be typed exactly right, or they will fail (or do something other than what you want).
Unix is case sensitive: it matters very much whether a letter is upper case (capital) or lower case (small).
man pwddisplays the online documentation for the command
man -kword gives a listing of all the commands related to word.
mv srcfile dstfile
srcfileto a file named
dstfile(i.e., change its name).
mvto move a file from one directory to another:
mv srcfile dstdirec
cp srcfile dstfile
srcfileto a new file named
dstfilealready exists, replace its contents with the contents of
newdirecas a subdirectory of the current working directory.
thisfileto the terminal.
cat srcfile1 srcfile2 > dstfile
srcfile2(dump them out one after the other) and put the concatenated output into
thisfileto the terminal in a controlled way.
||A user typing at the keyboard|
||Outputting to the terminal screen||Buffered: Regardless of when output statements occur in the program, outputting doesn't happen until a bunch of text has been saved up.|
||Outputting to the terminal screen||Unbuffered: Outputting happens as soon as an output statement is executed.|
Instead of input coming from a live user at the keyboard, or output going to the terminal screen, they can be redirected from or to a file.
program > outputfile
outputfile, instead of appearing on the terminal screen.
program < inputfile
inputfile, instead of being typed live by the user at the keyboard.
program < inputfile > outputfile
inputfile, and the output goes into
program >> outputfile
programis appended to the end of
The root directory (which is denoted by a slash
is the topmost directory;
all other directories are subdirectories of it.
It's like the "My Computer" icon in Windows, or like the desktop in MacOS.
The full name of a directory, starting from the root, is called a path. The full name of a file is its path, a slash and its filename. So, if a user
has a home directory
in which there's a subdirectory
and in the
is a file named
then the path of
and the file's full name is
Asterisks indicate parts of a filename that could be anything.
numbersomewhere in the name
The person who owns a file or directory gets to decide who can read it, who can write to it, and, if it's an executable, who can execute (run) it.
Paul DuBois, Using csh & tcsh. O'Reilly & Associates, 1995.
Daniel Gilly, Unix in a Nutshell, System V edition. O'Reilly & Associates, 1992.
Rebecca Thomas & Jean Yates, A User Guide to the Unix System. Osborne/McGraw-Hill, 1982.