Top "Sed" questions

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

How to use sed to replace the first space with an empty string

I am having trouble loading a space delimited text file into a table. The data in this text file is …

regex linux bash sed tr
sed: removing alphanumeric words from a file

I have file with a lot of text, what I want to do is to remove all alphanumeric words. Example …

sed text-formatting
Creating an output file with multi line script using echo / linux

Trying to create a small script capable to write a part off the script in the output file without any …

linux bash sed echo centos7
Prepend file names with plus sign

I want to add a + (plus sign) before all the occurrences of image names in a huge file, using sed. …

regex sed substitution
Whether to escape ( and ) in regex using GNU sed

I've noticed several posts on this site which say that with gnu sed you should use ( and ) in regex rather …

regex bash sed gnu
Using sed to delete a case insensitive matched line

How do I match a case insensitive regex and delete it at the same time I read that to get …

sed case-insensitive
sed command in dry run

How it is possible to make a dry run with sed? I have this command: find ./ -type f | xargs sed …

sed dry
sed extract digits

I try to extract digits with sed: echo hgdfjg678gfdg kjg45nn | sed 's/.*\([0-9]\+\).*/\1/g' but result is: 5 How …

sed extract digits
Counting regex pattern matches in one line using sed or grep?

I want to count the number of matches there is on one single line (or all lines as there always …

regex bash sed grep counting
How do I limit (or truncate) text file by number of lines?

I would like to use a terminal/shell to truncate or otherwise limit a text file to a certain number …

shell unix sed text-files head