Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 01-05-2015, 09:28 AM   #1
Registered: Aug 2012
Posts: 709

Rep: Reputation: Disabled
What is the "total" number returned by ls?

What is the "total" number signify? For instance, "total 4" and "total 12". For the record, I did read the man before asking this question, and I couldn't find anything about it (Centos 6 distro). Thank you

[Michael@devserver NewFolder1]$ man ls
[Michael@devserver NewFolder1]$ ls -l
total 4
-rwxrwxr-x. 1 phped phped 15 Jan  5 07:02 noname3.php
[Michael@devserver NewFolder1]$ ls -la
total 12
drwxrwxr-x. 2 phped phped 4096 Jan  5 07:02 .
drwxrwxr-x. 3 phped phped 4096 Jan  5 07:01 ..
-rwxrwxr-x. 1 phped phped   15 Jan  5 07:02 noname3.php
[Michael@devserver NewFolder1]$
Old 01-05-2015, 09:55 AM   #2
Registered: Apr 2012
Distribution: Gentoo
Posts: 570

Rep: Reputation: 133Reputation: 133
total parameter shows how many blocks occupied by files (at filesystem level).
Try this:
ls -h -l
it will show output in human-readable form. Blocks count will be replaced with real size.
Old 01-05-2015, 10:00 AM   #3
Registered: Aug 2012
Posts: 709

Original Poster
Rep: Reputation: Disabled
Thank you Teufel,

Funny how the man doesn't explain this.

It does describe the -h option:

-h, --human-readable
with -l, print sizes in human readable format (e.g., 1K 234M 2G)
And give a quick blurb at the bottom but doesn't indicate that the returned "total" value was size:
SIZE may be (or may be an integer optionally followed by) one of following: KB 1000, K 1024, MB 1000*1000, M 1024*1024, and so on for G, T, P, E, Z, Y.
Without having to ask the question, how could I have figured this out by myself?


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
/bin/ls "total" number reported??? JimDog Linux - Newbie 3 03-15-2012 01:46 PM
Total CPU utilization returned by "top" command sanpnair Linux - Newbie 1 05-15-2009 12:19 PM
OpenSuSE online update: "Helper program returned: invalid xml" pwabrahams Linux - Software 5 05-29-2008 11:38 PM
Compiling GIMP: "collect2: ld returned 1 exit status" linx win Debian 1 01-15-2007 12:08 AM
JBuilder install cancels - "No message error returned" bpatters Linux - Software 0 04-02-2004 01:57 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:57 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration