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!

Jay Bazuzi
  • 683
  • 5
  • 14
Jason Merandez
  • 383
  • 3
  • 6
  • 42
    Is your "friend" really a friend? – jscott Feb 07 '11 at 15:44
  • 15
    Apparently your friend does not want to answer your questions. Use ServerFault instead. – C. Ross Feb 07 '11 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 07 '11 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. ;) ]* – Dennis Williamson Feb 07 '11 at 15:53
  • 1
    That is quite mean. Funny, but quite mean. – Steven Feb 07 '11 at 18:00
  • Obviously you need to copy /dev/one to /dev/null :-)))) *joking* – Heiko Rupp Feb 07 '11 at 18:17
  • 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 07 '11 at 18:19
  • Oh @Jason, the stories you tell... – karlphillip Feb 08 '11 at 16:42

5 Answers5

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

Amandasaurus
  • 31,471
  • 65
  • 192
  • 253
  • 13
    +1 - "The bit bucket is full. Please empty it and press any key to continue." – Evan Anderson Feb 07 '11 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)! – Jason Merandez Feb 07 '11 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`. –  Feb 07 '11 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. – Jason B Shrout Feb 08 '11 at 00: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

MadHatter
  • 79,770
  • 20
  • 184
  • 232
  • Well, technically /dev/null didn't fill up since it wasn't a virtual file, but I guess it fits ;-) – Bart Silverstrim Feb 07 '11 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 '20 at 06: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.

Michael Lorton
  • 211
  • 2
  • 5
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.

phemmer
  • 5,909
  • 2
  • 27
  • 36
  • 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. – Bart Silverstrim Feb 07 '11 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.

Bart Silverstrim
  • 31,172
  • 9
  • 67
  • 87