Difference between revisions of "Line"

From wikieduonline
Jump to navigation Jump to search
Tags: Mobile web edit, Mobile edit
 
(13 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Draft}}
 
 
[[wikipedia:line]]
 
[[wikipedia:line]]
  
Line 8: Line 7:
 
{{concatenate lines}}
 
{{concatenate lines}}
  
 +
[[New line]]:
 +
* <code>[[echo]]</code>
 +
 +
Merge every two lines:
 +
* {{merge every two lines}}
 +
 +
Add line:
 +
* {{add line}}
 +
 +
[[Remove first line]]:
 +
* <code>[[tail -n +2]]</code>
  
 
== Activities ==
 
== Activities ==
* [[Concatenate lines
+
* [[Concatenate lines]]
]]
 
  
 
== Related ==
 
== Related ==
* <code>[[split (command)]]</code>
+
* <code>[[split (command)|spit]]</code>
* [[Column]]
+
* <code>[[column]]</code>
* [[Cisco IOS]]: <code>[[line vty]]</code>
 
* [[LINE]]
 
 
* <code>[[uniq]]</code>
 
* <code>[[uniq]]</code>
 
* <code>[[echo -n]]</code>
 
* <code>[[echo -n]]</code>
* [[Remove first line]]: <code>[[tail -n +2]]</code>
 
 
* <code>[[grep .]]</code>
 
* <code>[[grep .]]</code>
 +
* [[Cisco IOS]]: <code>[[line vty]]</code>
 +
* [[End of line]]
 +
* [[Line, Instant Messaging]]
  
 
== See also ==
 
== See also ==

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: