62

I tried gedit, nano, vi, leafpad and other text editors , it won't open, I tried cat and other file looking commands, and I ensure you it's a file not a directory!

Image

user16217248
  • 3,119
  • 19
  • 19
  • 37
Alfran
  • 1,301
  • 1
  • 10
  • 19

6 Answers6

116

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 ./-

Alfran
  • 1,301
  • 1
  • 10
  • 19
Prithvi Raj
  • 1,611
  • 1
  • 14
  • 33
26

Both cat < - and ./- command will give you the output

mapmalith
  • 1,303
  • 21
  • 38
7

you can use redirection

cat < -file_name

wyx
  • 3,334
  • 6
  • 24
  • 44
5

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.

michfuer
  • 101
  • 1
  • 5
0

I tried with pico or vi command.pico readme which allowed me open in editor and read the contents.

Praney Pareek
  • 49
  • 1
  • 5
0

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 ./-

BUSH JOSE
  • 1
  • 2