sed remove end of line code example
Example 1: delete a line starting with sed
# Delete all lines starting with '#'
$ sed -i '/^#/d' filepath
Example 2: sed remove first line
tail -n +2 "$FILE" > "$FILE.tmp" && mv "$FILE.tmp" "$FILE"
# Delete all lines starting with '#'
$ sed -i '/^#/d' filepath
tail -n +2 "$FILE" > "$FILE.tmp" && mv "$FILE.tmp" "$FILE"