Bash-sed-examples
Jump to navigation
Jump to search
Examples of using sed for different jobs
Remove all of a string until first match
echo "1=2=3" | sed 's/[^=]*=//' 2=3
Remove all after LAST match
echo "foo.bar.baz" | sed -e 's/\.[^.]*$//' foo.bar