Difference between revisions of "Paste"

From wikieduonline
Jump to navigation Jump to search
Tags: Mobile web edit, Mobile edit
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Merge every two lines:
+
{{lowercase}}
* <code>cat /path/tofile.txt | paste -d " "  - -</code><ref>https://stackoverflow.com/a/9605450</ref>
+
[[Merge]] every two [[lines]]:
* <code>cat /path/tofile.txt | xargs -n2 -d'\n'</code>
+
{{merge every two lines}}
 +
 
 +
 
  
  
Line 10: Line 12:
 
== See also ==
 
== See also ==
 
* {{cat}}
 
* {{cat}}
 +
* {{vi}}
  
 
[[Category:Linux commands]]
 
[[Category:Linux commands]]

Latest revision as of 06:05, 16 March 2023

Merge every two lines:

  • cat /path/tofile.txt | paste -d " " - -[1]
  • cat /path/tofile.txt | xargs -n2 -d'\n'



Related commands[edit]


See also[edit]

  • https://stackoverflow.com/a/9605450
  • Advertising: