0% found this document useful (0 votes)
66 views8 pages

Experiment - 4

Experiment-4 aimed to study commands for process and memory management in Linux. Key process management commands studied included ps, pstree, nice, kill, pkill, killall, xkill, fg, and bg. Memory management was analyzed using free, /proc/meminfo, top, htop, df, du, vmstat, dmidecode, sar, and pagesize to view memory usage, paging statistics, disk usage, and the system page size.

Uploaded by

JATIN TALREJA
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
66 views8 pages

Experiment - 4

Experiment-4 aimed to study commands for process and memory management in Linux. Key process management commands studied included ps, pstree, nice, kill, pkill, killall, xkill, fg, and bg. Memory management was analyzed using free, /proc/meminfo, top, htop, df, du, vmstat, dmidecode, sar, and pagesize to view memory usage, paging statistics, disk usage, and the system page size.

Uploaded by

JATIN TALREJA
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Experiment-4

Name-Tejas Shailendra Rokade


Div-D10A Roll no-46
Batch -B

Aim -To study commands for process management and memory


management.

A)Execution of Process management commands like


ps,pstree,nice,kill,pkill,killall,xkill,fg,bg,pgrep,renice,etc.

ps-ps command is short for ‘Process Status’. It displays the currently-running processes.
However, unlike the top command, the output generated is not in realtime.

Pstree-pstree is a Linux command that shows the running processes as a tree. It is used as a
more visual alternative to the ps command. The root of the tree is either init or the process with
the given pid. It can also be installed in other Unix systems
Nice-The nice command lets you run a command at a priority lower than the command's
normal priority. The Command parameter is the name of any executable file on the system. If
you do not specify an Increment value the nice command defaults to an increment of 10.

Kill-To stop a process in Linux, use the 'kill’ command. kill command sends a signal to the
process.
There are different types of signals that you can send. However, the most common one is ‘kill -9’
which is ‘SIGKILL’.
Pkill-The pkill command uses name of the process instead of PID number. Signal can be send
to a process either by typing full name or partial name.While specifying partial name, the
specified name should be within first 15 characters of the process name.

Killall-The killall command cancels all processes that you started, except those producing the
killall process. This command provides a convenient means of canceling all processes created by
the shell that you control.
Xkill-xkill is a command-line utility that can kill the undesired windows on the user's screen.
Basically, xkill force the X server to close the connection to the client. This utility kills the
programs without providing PID with a command.

Fg-Using the fg command to place a job into the foreground removes the job's process ID from
the list of those known by the current shell environment. The /usr/bin/fg command does not
work when operating in its own command execution environment, because that environment
does not have applicable jobs to manipulate.

Bg-bg command in linux is used to place foreground jobs in background. This command is
used to put the mentioned job in background. In the below screenshot, we do following :
1.We use jobs command to list all jobs
2.We create a process using sleep command, we get its ID as 1.
3.We put it in background by providing its ID to bg
Pgrep-The grep command searches for the pattern specified by the Pattern parameter and
writes each matching line to standard output. The patterns are limited regular expressions in the
style of the ed or egrep command. The grep command uses a compact non-deterministic
algorithm.

Memory Management -
1)Free -free displays the total amount of free and used physical and swap memory in the
system, as well as the buffers used by the kernel. The shared memory column should be ignored;
it is obsolete.

2)/proc/meminfo -The /proc/meminfo file inside the /proc pseudo-filesystem


provides a usage report about memory on the system. When we want to find out
statistics like used and available memory, swap space, or cache and buffers, we can
analyze this file’s contents.

3)Top-The top program provides a dynamic real-time view of a running system. It can display
system summary information as well as a list of tasks currently being managed by the Linux
kernel.
4)htop- htop is a useful command-line tool in the Linux environment to determine the cause of
load by each process. It is similar to Task Manager in the Windows OS environment

5)Df -a standard Unix command used to display the amount of available disk space for
file systems on which the invoking user has appropriate read access.
6)Du -The du command displays the number of blocks used for files. If the File
parameter specified is actually a directory, all files within the directory are reported on.
If no File parameter is provided, the du command uses the files in the current directory

7)Vmstat -The vmstat command reports statistics about kernel threads in the run and
wait queue, memory, paging, disks, interrupts, system calls, context switches, and CPU
activity.

8)dmidecode - The dmidecode command dumps the system's Desktop


Management Interface (DMI) table and presents it in a human-readable
format. The DMI table is an industry-standard for tracking information about
hardware components.

9)sar -The sar command is a standard UNIX command used to gather


statistical data about the system. With its numerous options, the sar command
provides queuing, paging, TTY, and many other statistics. The sar -d option generates
real-time disk I/O statistics.

10)pagesize-To obtain the size system page, enter: pagesize. The system returns the
number of bytes, such as 4096.
● To print the formatted page size, enter: pagesize -f. The system returns the formatted
page size (for example, 4K).

You might also like