Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've got a lot of files named 0 all over the place on my filesystem. They contain some digits (mostly also zeroes) inside.

I'am wondering what is it and where did they come from? I'm running OSX Lion Developer Preview 3, but i'm not sure if that's the case.


share|improve this question
Many terminal scripts and unix commands use 0 as the exit status to indicate that they ran successfully. Is it possible that you've somehow ended up redirecting the output from shell scripts or unix commands to empty files? I know I end up with misdirected output occasionally. Are they ending up in your home folder? – michaelmichael May 19 '11 at 21:19
up vote 2 down vote accepted

You might try running the command

sudo dtrace -qn 'syscall::open:entry /arg1&O_CREAT/ {printf("%5d %s file:%s\n",pid,execname,copyinstr(arg0));}' | grep '[:/]0$'

in a terminal window. The dtrace output will list the process ID, process name, and filename argument for any open() call with the O_CREAT flag set, meaning it will create the file if it does not already exist. Drop the final grep bit if you want to see all potentially file creating open() calls, but then the output might possibly overwhelm you. Hit ctrl-C when you're done with it.

If something keeps creating files named 0, the culprit ought to show up in the output.

(Edit: Fixed the grep invocation.)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.