38

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!

8
  • 42
    Is your "friend" really a friend?
    – jscott
    Feb 7, 2011 at 15:44
  • 15
    Apparently your friend does not want to answer your questions. Use ServerFault instead.
    – C. Ross
    Feb 7, 2011 at 15:48
  • 11
    With friends like that, who needs enemies? Also try sudo service apache2 start or sudo service httpd start to start Apache instead of calling the init.d script directly.
    – Ian C.
    Feb 7, 2011 at 15:51
  • 4
    To verify that /dev/null is empty: wc /dev/null. You should get all zeros (which is coincidentally the amount of attention you should pay to what your "friend" says). To empty /dev/null: cat /dev/null /dev/null [ OK, just kidding about that last one. ;) ] Feb 7, 2011 at 15:53
  • 2
    +1 to everyone for not laughing audibly until after giving the OP a straight answer. We've all been there at some point.
    – AndyN
    Feb 7, 2011 at 18:19

5 Answers 5

42

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

4
  • 13
    +1 - "The bit bucket is full. Please empty it and press any key to continue." Feb 7, 2011 at 15:44
  • 2
    Ahh I get it now, thanks (I googled /dev/null). I'm following a tutorial now to install "Apache", thanks for the help guys (sorry I can't upvote or accept all the correct answers)! Feb 7, 2011 at 15:59
  • 1
    @Jason I've done that by accident. When I rebooted, nothing came up...it's surprising how much startup scripts depend on the existence of /dev/null.
    – user47584
    Feb 7, 2011 at 18:40
  • 1
    If you want to cover your tracks you can create custom 'null' objects and dump logs to them... kinda like a black hole. Feb 8, 2011 at 0:02
25

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

2
  • Well, technically /dev/null didn't fill up since it wasn't a virtual file, but I guess it fits ;-) Feb 7, 2011 at 15:53
  • Debian 10. I have had a full /dev/null. Due to something wrong (I did?) with xfce4, I had a .xsession-errors file 300+Gb constantly and quickly growing filling my home in a couple of minutes. Then I though to symlink .xsession-errors to /dev/null, and still the same, disk is filled up. Rebooting the system empty the space, but I still wonder why /dev/null eats space and maybe, if it needs to be flushed somehow.
    – Paolo
    May 16, 2020 at 6:28
6

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.

2
  • You still use props or does it count coming from helicopter rotors too? Feb 7, 2011 at 19:35
  • 3
    @Bart rotor-wash is more concentrated -- you typically only need a half-gallon :)
    – voretaq7
    Feb 7, 2011 at 19:41
5

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.

1
  • 8
    It makes perfect sense as an answer if you're messing with someone who obviously doesn't know Linux and they want to make him look silly and embarrass him. Feb 7, 2011 at 15:52
4

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

Not the answer you're looking for? Browse other questions tagged .