0% found this document useful (0 votes)
68 views3 pages

Lab 3

This document provides instructions for Lab 3 on system attributes and using the word processor vi. It discusses process management using commands like ps and kill. It also lists some system commands to explore, including vmstat, pstree, pgrep, pkill, uptime and free. Finally, it describes how to use the vi editor, including inserting text, deleting characters and lines, saving, exiting and moving around files. Learners are asked to submit a word file describing commands like vmstat and capturing their terminal screen using vi.

Uploaded by

Tâm Lê
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)
68 views3 pages

Lab 3

This document provides instructions for Lab 3 on system attributes and using the word processor vi. It discusses process management using commands like ps and kill. It also lists some system commands to explore, including vmstat, pstree, pgrep, pkill, uptime and free. Finally, it describes how to use the vi editor, including inserting text, deleting characters and lines, saving, exiting and moving around files. Learners are asked to submit a word file describing commands like vmstat and capturing their terminal screen using vi.

Uploaded by

Tâm Lê
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/ 3

Subject: Operating Systems

Lab 3: System Attributes and


Using Word Processor
Learning outcome
Upon successful completion of this lab, you will be able
 How to use some commands that concert process and access the system attributes
 To use the word processor application (vi)

Submission
Upload the word file to cms describes some questions as
 Present the content of manipulating of some command (including syntax, what does
it for?, examples) as
o vmstat (view status of virtual memory)
o pstree –np
o pgrep <option> <parameter>: list process following name, properties …
o pkill
o uptime
o free
 Capture the terminal screen using the vi application to view the content of file that are
typed by you.

Tutorial
Content
1- Process management
2- Some System commands
3- Using the Editor Program vi

1- Process Management:

 View process status (ps) of the running process on the system: The ps command

Instructor: Kieu Trong Khanh, M.Eng – Modified by Thân Văn Sử Page 1


o Syntax: ps [-option]
o result
PID TTY TIME CMD
2412 tty1 00:00:00 bash
2433 tty2 00:00:00 ps
o option:
 -a: view all
 -ax: view all process, even though the process is not concern with tty
 -axl: view all process with the full command
TTY: Teletypewriter originally and now also means any terminal on Linux/Unix
systems. It also means any serial port on Unix/Linux systems.

 Stop a process ( the kill command)


o Requirement: the PID must be known
o Syntax: kill -9 PID
o Notes: if it is careless, the system is hang

2- Some System Commands

Use the man command to explore the following commands:

 vmstat (view status of virtual memory)


 pstree –np
 pgrep <option> <parameter>: list process following name, properties …
 pkill
 uptime
 free

3- Using the basic Editor Program vi

 Syntax: vi <file_name>

Instructor: Kieu Trong Khanh, M.Eng – Modified by Thân Văn Sử Page 2


 Manipulation
o Press key i: insert or type the content (in the left)

o Press key a: insert or type the content (in the right)


o ESC key: exit to command mode
o The key arrow is used to move in the content
o Key x: delete a character
o Key dd: delete a row

o Command
 :w: write file
 :q: exit vi
 :wq: write file and exit vi
 :e!: delete all the content that typing after writing file

o Some other key function


 Ctrl G: show the current line
 G: end of file
 1G: begin of file
 nG: goto n line

END

Instructor: Kieu Trong Khanh, M.Eng – Modified by Thân Văn Sử Page 3

You might also like