Difference between revisions of "Line"

From wikieduonline
Jump to navigation Jump to search
Line 25: Line 25:
 
* <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>
 
* [[Cisco IOS]]: <code>[[line vty]]</code>

Revision as of 10:06, 7 February 2024

This article is a Draft. Help us to complete it.

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

Activities

Related

See also

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