User Tools

Site Tools


linux:sed

This is an old revision of the document!


sed

Tool for doing stuff with lines, or perhaps stream of characters..

Using as regex to get stuff

By default, everything that is not deleted (by a delete command) is printed to stdout. To inhibit this, pass '-n' flag.

sed '/actual pattern/command'
 
# ex
sed '/Matches this string/p' # command p is printed. But since -d flag is not provided, so will everything else too
 
sed -n '/Matches this string/p' # Only prints rows containing "Matches this string"
linux/sed.1639224684.txt.gz · Last modified: 2022/09/12 00:30 (external edit)

Except where otherwise noted, content on this wiki is licensed under the following license: CC0 1.0 Universal
CC0 1.0 Universal Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki