OSG202 - LAB3: I. Commands

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

OSG202 – LAB3

I. Commands
1. vmstat
Syntax: vmstat [options][delay [count]]
Usage: Gives the information about processes, memory, paging, block IO, disk and
CPU scheduling

2. pstree
Syntax: pstree [options] [pid or username]
Usage: shows the running processes as a tree which is a more convenient way to display
the processes hierarchy and makes the output more visually appealing.
P/s: This was too big for terminal screen so I captured 2 pictures
3. pgrep
Syntax: pgrep [OPTIONS] <PATTERN>
Usage: Find process IDs of a running program based on give criteria such as part of a
name, users,…
Example: pgrep ssh for programs that have “ssh” as part of their name, and pgrep
peashooter for programs that their owner is user “peashooter ”.
4. pkill
Syntax: pkill [OPTIONS] <PATTERN>
Usage: Stop all running programs that matched some criterias such as owner, part of a
name,…
Example: I opened firefox browser, then stop it using pkill firefox (Desktop was cleaned
after the command)

5.uptime
Syntax: uptime [-options]
Usage: Show set of values that involve, the current time, and the amount of time system
is in running state, number of users currently logged into, and the load time for the past
1, 5 and 15 minutes respectively.
Example:

6. free
Syntax: free [OPTION]
Usage:  displays the total amount of free space available along with the amount of
memory used and swap memory in the system, and also the buffers used by the kernel.
Example:

II. Basic Editor Program vi

You might also like