Skip to content

Magenaut

  • Home
  • Topics
    • Notes
    • Tutorial
    • Bug fixing
    • Extension
    • Server
  • Q&A
  • Privacy Policy
  • About

sed

How to remove multiple newlines at EOF?

August 7, 2022 by Magenaut

I have files that end in one or more newlines and should end in only one newline. How can I do that with Bash/Unix/GNU tools?

Categories Q&A, Unix & Linux Tags awk, bash, ed, sed Leave a comment

Efficient way to print lines from a massive file using awk, sed, or something else?

August 7, 2022 by Magenaut

If I had a plain-text file containing 8 million lines and I want to print out lines 4,000,010 to 4,000,000 to the screen, which would be more efficient: awk or sed? There is no pattern to the text, and unfortunately, a database isn’t an option. I know this isn’t ideal, I’m just curious on which … Read more

Categories Q&A, Unix & Linux Tags awk, performance, sed Leave a comment

Convert rows to columns

August 7, 2022 by Magenaut

I have a file that includes details about VMs running in a hypervisor. We run some command and redirect the output to a file. And the is data available in the below format.

Categories Q&A, Unix & Linux Tags awk, sed, text-processing Leave a comment

Regex alternation/or operator (foo|bar) in GNU or BSD Sed

August 6, 2022 by Magenaut

I cannot seem to make it work. GNU sed documentation says to escape the pipe, but that doesn’t work, nor does using a straight pipe without the escape. Adding parens makes no difference.

Categories Q&A, Unix & Linux Tags regular-expression, sed, shell Leave a comment

Merge alternate lines from two files

August 6, 2022 by Magenaut

File1:

Categories Q&A, Unix & Linux Tags awk, paste, sed, text-processing Leave a comment

How to delete line if longer than XY?

August 6, 2022 by Magenaut

How can i delete a line if it is longer than e.g.: 2048 chars?

Categories Q&A, Unix & Linux Tags sed Leave a comment

How to get only filename using sed

August 6, 2022 by Magenaut

How can I get only the filename using sed? I’ve this

Categories Q&A, Unix & Linux Tags filenames, sed Leave a comment
Newer posts
← Previous Page1 … Page10 Page11
  1. michealSmith07 on Is there a way to dynamically refresh the less command?August 21, 2022

    That is a very nice post. I like this post.

  2. anonymous on Fix libwacom9 dependency issue when upgrade DebianJune 27, 2022

    saved my day!! Thanks for the help…

  3. sreedhar on Fix libwacom9 dependency issue when upgrade DebianMay 10, 2022

    Thanks its working

  4. saintnick on Fix libwacom9 dependency issue when upgrade DebianMay 10, 2022

    remove libwacom2 worked for me as well

  5. ranafoul on Fix libwacom9 dependency issue when upgrade DebianApril 22, 2022

    apt remove libwacom2 helped on kali 2022.01. gr8

.net ajax asp.net asp.net-core asp.net-mvc asp.net-mvc-3 asp.net-mvc-4 asp.net-web-api bash c# command-line css custom-post-types custom-taxonomy dataframe dictionary django entity-framework functions gridview html iis javascript jquery json linux list matplotlib numpy pandas php plugin-development plugins posts python python-2.7 python-3.x security shell shell-script sql string vb.net webforms wp-query

© 2026 Magenaut • Built with GeneratePress