Professional Documents
Culture Documents
Scheduler: it’s a program running in memory which decides which process should get the cpu
States of processes:
• submit
• hold
• ready
• run
• wait
• complete
When you execute a program the scheduler submits your process to a queue called process queue, at
this instant the process is said to be in submit state.
Once submitted the process waits its turn in the queue and this stage is called hold state.
Process advances in the queue at some instant it would become the next one in the queue to receive
CPU. At this stage its in ready state.
Finally the process gets the CPU and starts getting executed and at this stage its in run state.
When a process requires I/O operation, such processes are put in wait state.
A process whose execution comes to an end goes to complete state and is then removed from the
process queue.
Commands:
1. ps:
to see which processes are running at any instant(displays information about active processes)
or
it report a snapshot of the current processes.
Syntax
Ps [options]
Example:
PID: for every process UNIX assigns a unique number called processID(ranging between 0-
32767)
TTY: Terminal from which the processes were launched
TIME-elapsed time since the processes were launched
CMD: names of the processes
Sh/Bash: Bourne shell which is born the moment you login and dies only when you logout of the
system
Options:
a All users
t Terminal
f Full listing
e Every process running at that
instant
u User
L Nice values will be listed(long
format)
To find out which processes are running for the other users who have logged in execute the ps
command with the option –a.
This command displays processes of all the users.
To see what a particular user is doing
$ps –u Ubuntu
To find out the processes that have been launched from a particular terminal
ps –t tty1
Signals
2 Interrupt signal, terminating the
process
1 Hup signal-shutdown and restart
0 Used to check access to the
processid
1. tar command:
tar is used to create, maintain, modify and extract files that are archived in the tar format.
Creating an archive using tar command
a) creating an uncompressed tar archive using option cvf
$tar cvf archive-name.tar dirname/
cpio:
Cpio takes the list of files from the standard input while creating an archive and sends the output to the
standart output
$cd objects
$ls
$mkdir output
$cd output
• du
• df
• mount
• unmounts
du:
syntax:
du [option] [file]
options:
Basic form
$du
Display only directories that are occupying some disk are listed.
Options:
$du –a
$du –ahc
$du –sh
$du –achb
df
syntax:
df [option] ..[file]
options
a- all filesystems
-i inodes
Options
$df –a
$df –h –total
$df –i(instead of block usage list inodes
$df –T
Mount and Unmount
Syntax
mount [-lhv]
unmount [-hv]
1. telnet
telnet program is a user interface to the TELNET protocol ( terminal emulation that enables
a user to connect to a remote host or device using a telnet client).
Syntax: telnet [options] [host[port]]
Options:
-l user – specify user as the user to login as on the remote system
-n tracefile- opens tracefile for recording trace information
Example
$telnet myhost.com
Attempts to open a connection to the remote host myhost.com if a connection is
established, the host will prompt for a login name and password.
$telnet –l myusername myhost.com:5555
Attempts to open a connection to the remote host myhost.com on port 5555 using the login
name myusername
If successful, the host will prompt for myusername’s password.
$telnet
Opens a local telnet prompt
telnet>open myhost.com
will attempt to open a connection to myhost.com
2. rlogin:
remote login to a system
syntax:
rlogin [options] host
options: -l username
example:
rlogin –l hope domain.com
login as user hope to the remote system domain.com
3. ftp
ftp is the user interface to the ARPANET standard file transfer protocol its used to transfer
files to and from a remote network.
Syntax:
ftp [options] [host[port]]
options:
-4 use only ipv4 to contact to host
-6 use only ipv6 to contact to host
-g disables file name globbing
-d enables debugging
$ftp example.ch.com
It attempts a connection to specified host and ask for username and password if connection
establishes
If credentials are right
ftp> prompt opens
ftp > pwd
ftp >ls