Cannot open txt file in UNIX using cat utility

Hi,

I am not being able to open txt files with 'cat'. One thing to mention is, the filenames start with #. I guess one can have a unix filename that starts with a special/wildcard character. I have filenames starting with @ [like @filename] and they are opening perfectly with cat.

# generally used for comments in shell so it assumes that string after # as a comment.

you may try

cat "#file_n"
sdfd

cat #file_n here file_n is a comment as per the shell..:slight_smile:

I am not able to create a file with # in start of the name on ubuntu.
Can you rename it, or make the source program create files that do not start with # ?

@pamu : That works...Great....Thank U. :slight_smile:

@Jotne : I am able to rename the file starting with '#' as well as could create a file starting with '#'. I created the file using vi editor though, not by any source prog.

I found a working solution, use \ in front of #

cat \#test
nano \#test
vi \#test

@Jotne : yes, yes, thats also a solution I found out a few minutes ago :)..
actually '\' make cat escape '#' as a comment character....nice one