OSY 09ptttc
OSY 09ptttc
OSY 09ptttc
09
Name:Prathmesh Chopade
Roll No.: 11
Batch No.: T1
X. Practical Code:
Create a file OS and type at least 30 lines in it.
i) Write command to save the file.
Press Esc to ensure you're in command mode.
Type :w and press Enter.
:q!
:wq
:x
3. What is effect of (Type this at colon mode and observe the changes in your file)
a. set nu
b. set ic
c. set nonu
d. set noar
a. set nu: Displays line numbers on the left side of the text.
b. set ic: Enables case-insensitive search.
4YY copies four lines, and P pastes them at the cursor position, effectively duplicating those
lines.
XIII. Exercise:
1. Write the significance of following.
i. $ vi temp.txt
ii. Insert multiple lines.
iii. Delete contents using commands.
i. $vi temp.txt: Opens the Vi text editor to edit "temp.txt."
2. Create a new file and practice executing shell commands from within the
editor. Capture the results of some shell commands into the file.
To execute shell commands in Vi, use ! followed by the command. You can capture
the results by redirecting output to a file (e.g., :!ls > output.txt).
Get help in Vi by entering command-line mode with : and using :help followed by a topic
or command. You can also access the Vi manual with man vi in the terminal for detailed
documentation.