Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • 3
    Linux doesn't allow this... and I think most systems that do return the data in a unified format rather than whatever's actually in the filesystem. Commented Jul 17, 2015 at 12:19
  • 2
    This used to be possible back in the (very) old days. You can see evidence of this in K&R 2nd Edn. However, it is no longer possible; it hasn't been possible for most of this millennium. Commented Jul 17, 2015 at 12:40
  • This is possible, but unnecessary, under Unix systems - you can just use cat to display the contents if you like but hd (Unix equivalent of xxd) is probably more useful. I've noticed that Linux-based systems return an error if you open a directory file for reading, on the assumption it's a mistake. "By stopping stupid people doing stupid things, you also stop clever people doing clever things". Commented Feb 6, 2018 at 16:57