Computer Systems Assignment
Computer Systems Assignment
Whilst creating a file in Ubuntu is done using Cat commands in Debian vi is used, in the
home directory, call on vi by typing vi followed by the name of the file you wish to create. A
screen with a column of tildes (~) along the left side will appear on the monitor. Vi is now in
command mode. Anything you type will be understood as a command, not as content to
add to the file. To input text, you must type a command i. The two basic input commands
are i, which means inserting the text about to be typed to the left of the cursor, and a, which
means adding the text about be to type to the right of the cursor. Since you are at the
beginning of an empty file, either of these would work.
To further modify the fie with both Debian and Ubuntu if the command, dd is typed into the
terminal the dd command deletes the top line of the file. The command, x, deletes a single
character; the first letter of the line will be erased. Delete and backspace do not work in vi,
for historical reasons buts some vi variants, such as vim will let you use backspace and
delete. If you type a number before a command, it will repeat the command that many
times. For example, 2x will delete 2 characters and 5dd will delete 5 lines, q! will quit even
though changes to the file have not been saved. If wq is used the changes will be saved.