Strawberry
Strawberry

Reputation: 67938

Linux: /dev/null/: Is a directory

In an attempt to throw away my errors, I am getting this error. /dev/null/: Is a directory

What does that mean? and how can I make it so I can throw away my errors like so: echo "hello" 2>/dev/null/?

Upvotes: 4

Views: 5234

Answers (2)

Simone
Simone

Reputation: 11797

If /dev/null is a directory, something is wrong in your Linux system and you need to restore it. You do it with the following bash commands as root:

mknod /dev/null c 1 2
chmod 666 /dev/null

after having removed the null directory,

Upvotes: 4

John Kugelman
John Kugelman

Reputation: 361997

Get rid of the trailing slash.

echo "hello" 2>/dev/null

Upvotes: 16

Related Questions