Ch2 System Components
Ch2 System Components
System Components
System Components
Operating Systems
File Systems
Privileged accounts
What is System ?
(Human-computer system):- is an organized collaboration
between human and computers to solve a problem or provide a
service.
Three main components in a human-computer system:
1. Humans: who use and run the fixed infrastructure and cause
most problems.
2. Host computers: computer devises that run a software. these
might be in a fixed location or mobile devices.
3. Network hardware: a variety of specialized devises including
(Routers, Switches, cables and etc)
Operating Systems
Operating system
4
Operating Systems
Operating system
computer
5
What is Unix ?
programs.
6
Why Unix…?
Will make you a better computer scientist.
File System
UNIX.
10
File hierarchy
Window file system is changed through the different versions.
C:\I368 – the directory contains binary code and data for the
✓ Ordinary files
✓ Directory Files
✓ Device Files
✓ Links
The UNIX Filesystem…
1. Ordinary files
Ordinary files can contain text, data, or program information.
Files cannot contain other files or directories.
Unlike other operating systems, UNIX filenames are not broken into a
name part and an extension part (although extensions are still frequently
used as a means to classify files).
Instead they can contain any keyboard character except for '/' and be up to
256 characters long (note however that characters such as *,?,# and & have
special meaning in most shells and should not therefore be used in
filenames).
Putting spaces in filenames also makes them difficult to manipulate - rather
use the underscore '_'.
The UNIX Filesystem…
2. Directory Files
Directories are containers or folders that hold files, and other
directories.
3. Device Files
To provide applications with easy access to hardware devices, UNIX
allows them to be used in much the same way as ordinary files.
There are two types of devices in UNIX:
block-oriented devices which transfer data in blocks (e.g. hard disks)
and
character-oriented devices that transfer data on a byte-by-byte basis
(e.g. modems and dumb terminals).
The UNIX Filesystem…
4. Links
A link is a pointer to another file.
There are two types of links:
A hard link to a file is indistinguishable from the file itself.
pwd displays the full absolute path to your current location in the
filesystem. So
$ pwd
/usr/bin
$ ls
bin dev home mnt share usr var
boot etc lib proc sbin tmp vol
Actually, ls doesn't show you all the entries in a directory.
Files and directories that begin with a dot (.) are hidden (this
includes the directories '.' and '..' which are always present).
The reason for this is that files that begin with a . usually contain
important configuration information and should not be changed
under normal circumstances. If you want to see all files, ls supports
the -a option:
$ ls -a
Even this listing is not that helpful - there are no hints to properties
such as the size, type and ownership of files, just their names.
To see more detailed information, use the -l option (long listing),
which can be combined with the -a option as follows:
$ ls -a -l
(or, equivalently,)
$ ls -al
Each line of the output looks like this:
where:
type is a single character which is either 'd' (directory), '-' (ordinary file), 'l'
(symbolic link), 'b' (block-oriented device) or 'c' (character-oriented device).
permissions is a set of characters describing access rights. There are 9 permission
characters, describing 3 access types given to 3 user categories. The three access
types are read ('r'), write ('w') and execute ('x'), and the three users categories
are the user who owns the file, users in the group that the file belongs to and
other users (the general public). An 'r', 'w' or 'x' character means the
corresponding permission is present; a '-' means it is absent.
links refers to the number of filesystem links pointing to the file/directory.
owner is usually the user who created the file or directory.
group denotes a collection of users who are allowed to access the file according
to the group access rights specified in the permissions field.
size is the length of a file, or the number of bytes used by the operating system
to store the list of files in a directory.
date is the date when the file or directory was last modified (written to). The -
u option displays the time when the file was last accessed (read).
name is the name of the file or directory.
ls supports more options.To find out what they are, type:
$ man ls
man is the online UNIX user manual, and you can use it to get help
with commands and find out about what options are supported.
It has quite a terse style which is often not that helpful, so some
$ info ls
cd (change [current working] directory)
$ cd path
changes your current working directory to path (which can be an
absolute or a relative path). One of the most common relative paths
to use is '..' (i.e. the parent directory of the current directory).
Used without any target directory
$ cd
resets your current working directory to your home directory
(useful if you get lost).
If you change into a directory and you subsequently want to return
to your original directory, use
$ cd -
mkdir (make directory)
$ mkdir directory
creates a subdirectory called directory in the current working
directory.You can only create subdirectories in a directory if you
have write permission on that directory.
rmdir (remove directory)
$ rmdir directory
removes the subdirectory directory from the current working
directory.
You can only remove subdirectories if they are completely empty
(i.e. of all entries besides the '.' and '..' directories).
cp (copy)
cp is used to make copies of files or entire directories. To copy files, use:
$ cp source-file(s) destination
where source-file(s) and destination specify the source and destination of
the copy respectively. The behavior of cp depends on whether the
destination is a file or a directory. If the destination is a file, only one
source file is allowed and cp makes a new file called destination that has
the same contents as the source file. If the destination is a directory,
many source files can be specified, each of which will be copied into the
destination directory.
To copy entire directories (including their contents), use a recursive copy:
$ cp -rd source-directories destination-directory
mv (move/rename)
mv is used to rename files/directories and/or move them from one
directory into another. Exactly one source and one destination must be
specified:
$ mv source destination
The permissions are read (r), write (w) and execute (x), and the
is as follows:
For example the command:
$ chmod 600 private.txt
sets the permissions on private.txt to rw------- (i.e. only the owner can
read and write to the file).
Permissions may be specified symbolically, using
symbols u (user), g (group), o (other), a (all), r (read), w (write), x (e
xecute), + (add permission), - (take away permission) and = (assign
permission).
For example, the command:
$ chmod ug=rw,o-rw,a-x *.txt
sets the permissions on all files ending in *.txt to:
rw-rw---- (i.e. the owner and users in the file's group can read and write
to the file, while the general public do not have any sort of access).
chmod also supports a -R option which can be used to
Will grant group and other read rights to the directory play and
Can be used to change the group that a file or directory belongs to.
taken place so that one can later go back and see exactly what
happened at a given time.
restriction.
normal work.