linux sed remove line starting with in a file code example Example: delete a line starting with sed # Delete all lines starting with '#' $ sed -i '/^#/d' filepath