Skip to content

Magenaut

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

sed

Delete last line from the file

August 7, 2022 by Magenaut

I use sed to quickly delete lines with specific position as

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

How to delete the rest of each line after a certain pattern or a string in a file?

August 7, 2022 by Magenaut

Suppose I have a list of URLs in a text file:

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

Delete range of lines above pattern with sed (or awk)

August 7, 2022 by Magenaut

I have the following code that will remove lines with the pattern banana and 2 lines after it:

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

Delete specific line number(s) from a text file using sed?

August 7, 2022 by Magenaut

I want to delete one or more specific line numbers from a file. How would I do this using sed?

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

find & sed (search and replace)

August 7, 2022 by Magenaut

I’m using the following command on my mac:

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

Diff, show modified line from right file only

August 7, 2022 by Magenaut

I have file a and b and I would like to output lines of b that changed since it was cloned from a. Just the modified lines, no surrounding context, no diff offset marks.

Categories Q&A, Unix & Linux Tags awk, diff, sed, shell-script Leave a comment

How to add a carriage return before every newline?

August 7, 2022 by Magenaut

I have a file that only uses n for new lines, but I need it to have rn for each new line. How can I do this?

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

sed – remove the very last occurrence of a string (a comma) in a file?

August 7, 2022 by Magenaut

I have a very large csv file. How would you remove the very last , with sed (or similar) ?

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

sed with multiple expression for in-place argument

August 7, 2022 by Magenaut

I am trying to replace multiple words in a file by using

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

Escaping both forward slash and back slash with sed

August 7, 2022 by Magenaut

I have the following string: /tmp/test/folder1/test.txt

Categories Q&A, Unix & Linux Tags bash, sed Leave a comment
Older posts
Newer posts
← Previous Page1 … Page9 Page10 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