If you can see this check that

next section prev section up prev page next page

Copying Text

To copy a few lines of text, you can use the yank command (yy) with the put command.


This is the first line of text.
This is the second line of text.
This is the third line of text.
This is the fourth line of text.

To duplicate the above lines of text you can proceed as follows:

  1. Position the cursor anywhere on the first line.
  2. Type the following command to copy the four lines of text: 4yy
  3. Move the cursor down to the fourth line.
  4. Type p (lower case) to put the copied lines immediately below the fourth line.

You should now see the following:


This is the first line of text.
This is the second line of text.
This is the third line of text.
This is the fourth line of text.
This is the first line of text.
This is the second line of text.
This is the third line of text.
This is the fourth line of text.

yy
Yank (copy) the current line
nyy
Yank the next n lines
yw
Yank a copy of a word

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 | Registry | 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