0
0
Linux CLIscripting~10 mins

vim basics (insert, command, save, quit) in Linux CLI - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to enter insert mode in vim.

Linux CLI
vim filename.txt
Press [1] to start typing.
Drag options to blanks, or click blank then click option'
Ai
B:w
C:q
Dx
Attempts:
3 left
💡 Hint
Common Mistakes
Pressing ':w' which is for saving, not inserting.
Pressing ':q' which quits vim.
Pressing 'x' which deletes a character.
2fill in blank
medium

Complete the command to save changes in vim.

Linux CLI
In command mode, type [1] and press Enter to save the file.
Drag options to blanks, or click blank then click option'
A:w
B:i
C:q
D:x
Attempts:
3 left
💡 Hint
Common Mistakes
Using ':q' which quits without saving.
Using ':i' which is for insert mode.
Using ':x' which saves and quits but is not just save.
3fill in blank
hard

Fix the error in the command to quit vim without saving.

Linux CLI
Type [1] and press Enter to quit without saving.
Drag options to blanks, or click blank then click option'
A:x
B:q!
C:wq
D:w
Attempts:
3 left
💡 Hint
Common Mistakes
Using ':wq' which saves and quits.
Using ':x' which saves and quits.
Using ':w' which only saves.
4fill in blank
hard

Fill both blanks to save and quit vim in one command.

Linux CLI
Type [1][2] and press Enter to save and quit.
Drag options to blanks, or click blank then click option'
A:w
Bq
C!
D:x
Attempts:
3 left
💡 Hint
Common Mistakes
Using ':x' which saves and quits only if modified.
Using ':q!' which quits without saving.
Using ':w!' which forces save but not quit.
5fill in blank
hard

Fill all three blanks to save and quit vim with a single command that forces saving.

Linux CLI
Type [1][2][3] and press Enter to save and quit forcefully.
Drag options to blanks, or click blank then click option'
A:w
Bq
C!
D:x
Attempts:
3 left
💡 Hint
Common Mistakes
Using ':x!' which updates and quits forcefully if modified.
Using ':q!' alone which quits without saving.
Using ':w!' which saves but does not quit.