Difference between revisions of "Paste"

From wikieduonline
Jump to navigation Jump to search
Tags: Mobile web edit, Mobile edit
 
Line 1: Line 1:
 
{{lowercase}}
 
{{lowercase}}
 
[[Merge]] every two [[lines]]:
 
[[Merge]] every two [[lines]]:
* <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>
+
 
 +
 
  
  

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: