Skip to content

Magenaut

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

sed

sed fails to remove newline character

August 9, 2022 by Magenaut

I’ve been using sed for quite some time but here is a quirk I came around with, which I am not able to resolve.

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

What is the purpose of “~” in the command “sed ‘s~ ~~g'”?

August 8, 2022 by Magenaut

I found line sed ‘s~ ~~g’ in a shell script on a Linux system. What is this ~? Answers: Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or … Read more

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

How to escape a single quote?

August 8, 2022 by Magenaut

end the single-quoted string, add escaped (either by backslash or double quotes) single quote, and immediately start the following part of your string:

Categories Q&A, Unix & Linux Tags escape-characters, quoting, scripting, sed, shell Leave a comment

Insert text in specific lines of a file

August 8, 2022 by Magenaut

How can I insert some text in specific lines of a file? What is the simplest method that I can use? (bash, sed, awk?)

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

split file into two parts, at a pattern

August 8, 2022 by Magenaut

How to split a large file into two parts, at a pattern?

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

Are there zero-width assertions in sed?

August 8, 2022 by Magenaut

Is it possible to make lookahead or lookbehind zero-width assertions in sed? I want to emulate Perl’s (?=) and family.

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

Is there a faster way to remove a line (given a line number) from a file?

August 8, 2022 by Magenaut

A related question is here.

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

Show lines matching a pattern and the 4 lines before each

August 8, 2022 by Magenaut

For example, from this file:

Categories Q&A, Unix & Linux Tags awk, command-line, grep, hp-ux, sed Leave a comment

Replace non-printable characters in perl and sed

August 8, 2022 by Magenaut

I need to replace some non-printable characters with spaces in file.

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

How to find what device a file is on (and use that in a script)?

August 8, 2022 by Magenaut

I want to find out what device my file is on so that I can use it in a script. I can get this far:

Categories Q&A, Unix & Linux Tags awk, files, sed, shell Leave a comment
Older posts
Newer posts
← Previous Page1 … Page6 Page7 Page8 … Page11 Next →
  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