Skip to content

Instantly share code, notes, and snippets.

@ecelis

ecelis/sed_onliner.sh

Last active Oct 9, 2019
Embed
What would you like to do?
## Delete empty line from file
sed -i '/^$/d' <file.ext>
## Delete empty espace at the begining of line
sed -i '/^\s//g' <file.ext>
## Delete email prefix (address@)
sed -i -e 's/[[:alnum:]].\.*[[:alnum:]]*@//g' <file.ext>
## Delete only numbers line
sed -i 's/^[0-9]*$//g' <file.ext>
## Add new line after line match the rick is in the /a
sed -i '/LINETEXT=something/a NEWLINE=somethingelse/' <file.txt>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment