Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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.