If you can see this check that

next section prev section up prev page next page

Deleting Text

vi offers various ways to delete text in a file. You can delete text from the cursor back to the first line of text, and from the cursor to the last line of text.

x
Delete character at cursor
X
Delete character after cursor
nx
delete n characters, starting at cursor
dw
deletes one word
ndw
delete from cursor to beginning of n th word
dd
Deletes current line
ndd
Delete next n lines, including the current line
d$
Deletes from cursor to the end of the current line
d^
Deletes from cursor to the beginning of current line
d1G
All lines to beginning of file, including current line
dG
All lines are deleted to the end of the file, including current line.


Centos 7 intro: Paths | BasicShell | Search
Linux tutorials: intro1 intro2 wildcard permission pipe vi essential admin net SELinux1 SELinux2 fwall DNS diag Apache1 Apache2 log Mail
Caine 10.0: Essentials | Basic | Search | Acquisition | SysIntro | grep | MBR | GPT | FAT | NTFS | FRMeta | FRTools | Browser | Mock Exam |
Caine 13.0: Essentials | Basic | Search | Acquisition | SysIntro | grep | MBR | GPT | FAT | NTFS | FRMeta | FRTools | Browser | Mock Exam |
CPD: Cygwin | Paths | Files and head/tail | Find and regex | Sort | Log Analysis
Kali: 1a | 1b | 1c | 2 | 3 | 4a | 4b | 5 | 6 | 7a | 8a | 8b | 9 | 10 |
Kali 2020-4: 1a | 1b | 1c | 2 | 3 | 4a | 4b | 5 | 6 | 7 | 8a | 8b | 9 | 10 |
Useful: Quiz | Forums | Privacy Policy | Terms and Conditions

Linuxzoo created by Gordon Russell.
@ Copyright 2004-2024 Edinburgh Napier University