CSCI322 2
CSCI322 2
SystemsAdministration
School of Computing and Information Technology
University of Wollongong
Courseware developed with input from Daniel Saffioti and William Tibben
What is an operating system?
1. Memory Manager
Controls and tracks the use of computer memory (RAM).
Allocates memory to programs and frees it up when it's no longer needed.
2. Process Manager
Manages the CPU's time and decides which program runs and for how long.
Keeps track of active processes and handles their execution.
3. Device Manager
Manages communication between the computer and connected hardware (like printers, keyboards, or hard drives).
Allocates and deallocates devices to programs as needed.
4. File Manager
Handles the creation, deletion, reading, and writing of files.
Manages access to files and ensures security and organization in storage.
5. Network Manager
Manages network connections, enabling communication between computers.
Handles data transfer over the internet and local networks.
6. User Command Interface
Provides a way for users to interact with the computer, either through a Graphical User Interface (GUI) (like Windows or macOS) or a Command Line Interface (CLI) (like Linux terminal).
In Short:
The Operating System is like the boss of your computer, coordinating all activities between hardware and software to ensure everything functions properly and efficiently.
The UNIX operating system
UNIX kernel
Hardware
Common UNIX shells
Command Description
ls List your files
more filename Show the first part of a file
emacs filename Create and edit a file
vi filename Create and edit a file
mv fn1 fn2 Move a file
cp fn1 fn2 Copy a file
rm filename Remove a file
diff fn1 fn2 Compare files, and show where they differ
wc filename How many lines, words, and characters
chmod Change the permission of a file
Some common UNIX command
Command Description
gzip filename Compress a file
gunzip filename Uncompress a file
gzcat filename Look at a gzipped file without having to gunzip
it
cat filename Look at the content of the file
lpr filename Print
mkdir dirname Make a new directory
cd dirname Change the directory
pwd Where you are
grep string fn(s) Look for the string in the files.
Some common UNIX command
Command Description
w Who’s logged in and what they are doing
who Who’s logged in and there they are coming from
finger Display information on system users
last Give a list of everyone’s logins
id Display the user id and group id
uname -a Display all information about the system
date Current date and time
cal Display the calendar of the current month
exit Exit the current shell
Some common UNIX command
Command Description
whoami Return your usename
passwd Change your password
ps Display current processes
kill PID Kill the process with the id you have
quota -v Show what your disk quota is
echo Print text to the terminal screen
mail Send file by email
ssh Open a secure connection
ftp Upload or download file
!! Repeat the previous command
Obtain command help
Section Description
number
1 Commands that any user may execute
1M Command that only root user may execute
X1M X Windows commands that only the root user
may execute
2 System calls
3 Library routines and functions
3M Mathematical functions
3F Fortran functions
4 File formats
5 Miscellaneous
6 Games
7 Device drivers and interfaces
Shell metacharacters
Metacharacter Description
$ Shell variable
& Background command execution
; Command termination
< << > >> I/O redirection
| Command piping
* ? [] Shell wildcards
‘“\ Metacharacter quotes
` Command substitution
() {} Command grouping
Command input and output
Option Meaning
-b Ignore leading whitespace
-f Case insensitive sorting
-k Specify the columns that form the sort key
-n Compare fields as integer numbers
-r Reverse sort order
-t Set field separator (the default is whitespace)
-u Output unique records only
Operator True if
-d file file exists and is a directory
-e file file exists
-f file file exists and is a regular file
-r file You have read permission on
the file
-s file file exists and is not empty
-w file You have write permission on
the file
file1 –nt file2 file1 is newer than file2
file1 –ot file2 file1 is older than file2
Loops
• ^\d{4}$
• Letter[^1238]
• (mother|father)
• M[ou]’?am+[ae]r ([Aeae]|[-
])?[GKQ]h?[aeu]+([dhz]|[dhz]?){1,2}af[iy]
The grep command
You get all the file-testing operators shown in Slide 48 except for
the –nt and –ot operators
Control flow