-
Please define your problem with more details. – Seeker Feb 12 '17 at 12:07
-
@SyedMuhammadZulqarnain i wan't to open a file whose name is a hyphen i.e. - , the question is as simpler as it sounds. like if i do "ls" then it shows me a file named "-" , i want to open this file and see the content inside this. – Alfran Feb 12 '17 at 12:14
-
Possible duplicate of How do I deal with a filename that starts with the hyphen (-) character? – Benjamin W. Feb 12 '17 at 19:51
-
1Are you doing www.overthewire.org/wargames/ ? – Daniel Kurniadi Jan 30 at 6:12
This type of approach has a lot of misunderstanding because using - as an argument refers to STDIN/STDOUT i.e dev/stdin or dev/stdout .So if you want to open this type of file you have to specify the full location of the file such as ./- .For eg. , if you want to see what is in that file use cat ./-
It looks like the rev
command doesn't treat -
as a special character.
From the man page
The rev utility copies the specified files to standard output, reversing the order of characters in every line.
so
rev - | rev
should show what's in the file in the correct order.