Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Development Tools

Command line - /dev/null

I was playing around on terminal the other day and noticed the /dev/null directory, which I understand is a special directory used for deleting files in Unix. But the file on my system is over 17 gigs. Can I safely delete this file and trust the system to make a "fresh" one upon reboot? Why does it need to take up so much space?

2 Answers

James Barnett
James Barnett
39,199 Points

Post the output of

ls -la /dev/nul && du -g /dev/null

thanks james, upon further investigation it was determined that i can't read :P it was actually a file named devnull in my user directory. i have no idea what it is but because of the size i'm thinking it's some weird output from when I was using handbrake to encode a few movie files a long long time ago.

James Barnett
James Barnett
39,199 Points

That makes much better sense. You probably tried to redirect standard error to /dev/null and instead redirect standard input into a file.