Top "Sed" questions

Sed (Stream EDitor) is a command line editor for POSIX environment.

Add a header to a tab delimited file

I'd like to add a header to a tab-delimited file but I am not sure how to do it in …

linux unix sed awk cat
Delete to end of line after a match, keep lines not matched

I have a file of the following form: interesting text-MIB blah blah blah VERY INTERESTING TEXT interesting text-MIB blah blah …

sed line string-matching
How to remove tabs from blank lines using sed?

I'd like to use sed to remove tabs from otherwise blank lines. For example a line containing only \t\n …

tabs sed code-formatting blank-line
Extract The Second Word In A Line From A Text File

I am currently in need to extract the second word (CRISTOBAL) in a line in a text file. * CRISTOBAL AL042014 08/05/14 12 …

bash unix awk sed cut
sed -i command for in-place editing to work with both GNU sed and BSD/OSX

I've got a makefile (developed for gmake on Linux) that I'm attempting to port to MacOS, but it seems like …

macos sed gnu inplace-editing
The Concept of 'Hold space' and 'Pattern space' in sed

I'm confused by the two concepts in sed: hold space and pattern space. Can someone help explain them? Here's a …

linux sed
Boolean OR in sed regex

I'm trying to replace all references of a package named boots in a configuration file. The line format is add …

regex sed logical-operators
What's wrong with my lookahead regex in GNU sed?

This is what I'm doing (simplified example): gsed -i -E 's/^(?!foo)(.*)$/bar\1/' file.txt I'm trying to put …

regex linux sed regex-lookarounds
Remove all lines before a match with sed

I'm using sed to filter a list of files. I have a sorted list of folders and I want to …

regex perl sed awk pattern-matching
List all files that do not match pattern using ls

Possible Duplicate: How can I use inverse or negative wildcards when pattern matching in a unix/linux shell? I've read …

shell command-line sed terminal ls