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 Console Foundations Getting Started with the Console Running Commands

ls -l and ls-a give Total:0

Having or not hidden files/directories the total on the top of the list displays always 0 for whatever number of files I have in the current directory. I am using mac's terminal. What does it mean? Is this normal?

1 Answer

Steven Parker
Steven Parker
215,940 Points

I wouldn't expect to see a "total" line from the command "ls -a". But I would for "ls -l", and I would not expect to see 0 shown for a non-empty directory.

From "man 1 ls" on Mac OS X 10.6.7, specifically the section titled "The Long Format":

,,, for each directory whose contents are displayed, the total number of 512-byte blocks used by the files in the directory is displayed on a line by itself, immediately before the information for the files in the directory.

Thank you:) Strange, now I tried again and with ls -l gave me in fact the correct total number. Yes, you are right with ls -a there is no total to display.