Professional Documents
Culture Documents
UNIX
An Operating System is a resource manager. It
UNIX
More importantly for todays networked world:
UNIX Architecture
Layered architecture: 3 parts (kernel, shell,
programs)
Kernel: is the core of the UNIX OS. It is in
direct control of the underlying hardware and
provides the low-level processor, memory
and device management functions
Example: allocating memory for programs
Shell: Acts as the interface between the user
and the kernel
UNIX Architecture
The user issues a command to the shell which
process
A file is a collection of data; could be text or
binary
A process is a currently executing program
uniquely identified by a PID (Process
Identifier)
Paths
Absolute path always starts from the root /
Relative path relative to the current working
directory
Current directory: represented by a single dot
.
Parent directory: represented by 2 dots ..
Home directory: represented by a tilde ~
UNIX Commands
0) man display the manual for a command
1) date display todays date
2) clear clear screen
3) echo echo content
4) cd change directory
5) mkdir make a new directory
6) pwd display the present/current working
directory
More Commands
7) rmdir remove directory
8) ls list contents of a directory
9) cat display contents of a file
10) head display head (first 10 lines) of a file
11) tail display tail (last 10 lines) of a file
12) more display a file page-wise
13) wc display number of lines, words and
characters in a file
More Commands
14) mv move/rename a file/directory
15) cp copy a file
16) rm delete/remove a file
17) sleep delay for a specified period of time
chmod Command
18) chmod change permissions on a
file/directory
Permission values: 4 read (r) / 2 write (w) / 1
execute (x)
Example: chmod 644 fileName
sets permissions of rw-r--r-- for fileName
The first digit is for owner, the second digit for
the group that the owner belongs to and the
third digit for everyone in the system