Skip to content

Instantly share code, notes, and snippets.

@ecelis
Last active October 9, 2019 03:18
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save ecelis/d641c7b319215a6b6450e1b010fc70f0 to your computer and use it in GitHub Desktop.
## 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