How Do I Copy a Line from One File to Another in Linux?
Contents

How do I copy text from one file to another in Linux?

if you just want to replace one file content with other file content then you can do like :

  1. copy command : cp file anotherfile.
  2. cat command: cat file > anotherfile.
  3. If you want to use editor then you can use gedit editor : gedit file.

7 окт. 2016 г.

How do you copy a line in Linux?

To copy a line requires two commands: yy or Y (“yank”) and either p (“put below”) or P (“put above”). Note that Y does the same thing as yy . To yank one line, position the cursor anywhere on the line and type yy . Now move the cursor to the line above where you want the yanked line to be put (copied), and type p .

Robert Thorne

Robert Thorne

Automotive & Future Transportation Editor

Robert Thorne covers electric vehicle innovations, autonomous driving systems, global mobility trends, and automotive engineering developments.

Share this article
Twitter Facebook Pinterest