Page 141 - DCAP106_OPERATING_SYSTEM_TOOLS
P. 141
Operating System Tools
Notes z z fg: On using this commad, a process running in the background will be processed in the
foreground.
$ fg % 2
cat *.cpp > mytext
$
z z kill: This command cancels a job running in the background. It takes argument either the
user job number or the system process number.
$jobs
[1] + Running cp *.c > mytext
[2] - Running cp *.dat >>mytext
$kill %2
z z bg: This command places a suspended job in the background.
$ cat *.cpp > mytext
^Z
$bg
!
Caution Ctrl + Z will suspend the process running at the moment.
z z ps: This command reports a snapshot of the current processes.
z z top: This command is used to display Linux tasks.
z z at: This command executes commands at a specified time.
$ at 8:00
at > echo “HI” > /dev/tty1
In order to return to the command line, press ‘ctrl + d’ . This will display the message in
tty1 at 8′o clock.
z z To view the schedule: $ atq
z z To cancel a job: $atrm 5 [job ID]
z z crontab: crontab is a file containing the schedule of entries to run at specified times.
z z shutdown: This command is used to bring the system down.
z -r: This option requests that the system be rebooted after it has been brought down.
z -c: This option is used to cancels a running shutdown.
Task Compare and contrast system process number and user job number.
8.1.8 Other Commands
Some other commands are defined as below:
z z whoami: This command displays the login name of the current effective user.
z z logname: This command is used to print user´s login name.
134 LOVELY PROFESSIONAL UNIVERSITY