Display file without # lines

Hi
to all in this great forum, im sure this has been asked lots of times before but ive been looking for the past day and cant find the answer.

I use cat/some/file to display its contents but how can i get it to not display hashed out lines, or do i need another command,
Thanks in advance:)

grep -v '^#' data.file

For basic use grep (man grep) or for more advanced options awk or sed.

grep -v "^#" /some/file

maybe does the trick....

edit: to late :wink:

You can also use sed

sed "/^#/d" file

... and awk :rolleyes:

awk '! /^#/' file

Thanks all that did the trick, though it didnt work out the way i expected, i use the command to show whats in a file then edit it and automatically save when closed
it does open the fie, allows me to edit it then saves it when i close it, only trouble is it does not usually display the original contents of the file, however it sometimes does but very accasionally

sed "/^#/d" /somefile | zenity --text-info --width=560 --editable > somefile