Difference between revisions of "Line"

From wikieduonline
Jump to navigation Jump to search
 
(22 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{Draft}}
 
 
[[wikipedia:line]]
 
[[wikipedia:line]]
  
Line 5: Line 4:
 
* <code>[[wc -l]]</code>
 
* <code>[[wc -l]]</code>
  
[[Concatenate]] lines:
+
[[Concatenate lines]]:
* <code>[[cat]] file | [[tr]] '\n' ' '</code>
+
{{concatenate lines}}
  
 +
[[New line]]:
 +
* <code>[[echo]]</code>
  
 +
Merge every two lines:
 +
* {{merge every two lines}}
  
== Related commands ==
+
Add line:
* <code>[[split (command)]]</code>
+
* {{add line}}
* [[Column]]
+
 
 +
[[Remove first line]]:
 +
* <code>[[tail -n +2]]</code>
 +
 
 +
== Activities ==
 +
* [[Concatenate lines]]
 +
 
 +
== Related ==
 +
* <code>[[split (command)|spit]]</code>
 +
* <code>[[column]]</code>
 +
* <code>[[uniq]]</code>
 +
* <code>[[echo -n]]</code>
 +
* <code>[[grep .]]</code>
 
* [[Cisco IOS]]: <code>[[line vty]]</code>
 
* [[Cisco IOS]]: <code>[[line vty]]</code>
* [[LINE]]
+
* [[End of line]]
* [[uniq]]
+
* [[Line, Instant Messaging]]
  
 
== See also ==
 
== See also ==
 +
* {{line}}
 
* {{files}}
 
* {{files}}
  
 
[[Category:Linux]]
 
[[Category:Linux]]

Latest revision as of 08:40, 29 June 2024

wikipedia:line

Count lines:

Concatenate lines:

New line:

Merge every two lines:

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

Add line:

  • grep -qxF 'your text "additional text"' yourfile.txt || echo 'your text "additional text"' >> yourfile.txt

Remove first line:

Activities[edit]

Related[edit]

See also[edit]

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