How do I empty /dev/null? [closed]

I am using Ubuntu 10.10.

I am generally good with computers but mostly with Windows, I'm not very familiar with Ubuntu. I'm trying to setup a website and I'm talking with a friend I have who works for a school IT department who is giving me advice.

He told me that I need to open a command-prompt and type in sudo /etc/init.d/apache2 start but when I do all I see is sudo: /etc/init.d/apache2: command not found.

I told my friend the error and he said that my file /dev/null was full, so I tried to find it but it's a hidden file. I know how to view hidden files in Windows but not in Ubuntu.

My friend is offline now so I'm hoping someone can tell me how to delete my /dev/null? Thanks!


Solution 1:

It's not possible to empty /dev/null, that doesn't make sense. Your friend is joking with you.

However it sounds like you don't have apache2 installed. You should be able to install it with sudo aptitude install apache2

Solution 2:

Whilst I agree with all the other posters, that in this case your friend is messing with you, I have had a system where /dev/null filled up.

Somehow, /dev/null got deleted, and the next time someone did

verbose-command > /dev/null

it completely filled up the root partition with a single, large file called /dev/null, and the command stalled because it could no longer write to /dev/null. We found no more efficient way to describe this than "/dev/null filled up".

I must stress that I don't think that's your problem, in this case. The explanation about not having the apache2 package installed is much more likely! And under no circumstances should you delete /dev/null, its presence is necessary for sane system operation.

Edit: and some four years later, in a nice case of life imitating art, it seems Server Fault finally has such a question: File is too big for /dev/null

Solution 3:

In the Air Force, newbies are sent to retrieve a gallon of prop-wash or 50 yards of flight line. I guess this the sys-op equivalent. Your friend is just having some fun at your expense.

Solution 4:

First thing you should do is to stop listening to your friend. Seriously, that advice he gave you makes absolutely no sense. The '/dev/null' isnt a file, it cant get full, its a special device node that your system uses for various purposes.

Your command is likely failing because apache is not installed. Try installing it first and see if you have any better results.

Solution 5:

Look up the definition of "null" and you'll have reason to hit your friend with a "cluebat" for messing with you.