LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 08-01-2005, 11:13 PM   #1
JrLz
Member
 
Registered: Mar 2004
Location: Jakarta
Posts: 164

Rep: Reputation: 30
what does total means in `ls -l`


excuse me newbies or Gurus out there....
anyone can explain me what the meaning of "total" on the top row of the
`ls -l` command output ????
seems that a file counts 1 , and a folder counts 2........
why is the folder counted 2?
is it the (.) , (..) folder in it? or what?

thx for any explaining......
maybe some help of how ls works.........

Last edited by JrLz; 08-01-2005 at 11:15 PM.
 
Old 08-01-2005, 11:19 PM   #2
jrdioko
Member
 
Registered: Oct 2002
Distribution: Debian 6.0.2 (squeeze)
Posts: 944

Rep: Reputation: 30
The following is from "man ls" (type "man command" to see information about command):

Code:
When the -l option is given, each list is preceded by a  summary  line giving the total size of all files in the list, measured in semi-kilobytes (512 B).
The "." directory is the one you're currently in. For example, to move the file "foo" in the directory "/home/me" to the directory you're currently in, whatever that might be, type "mv /home/me/foo ."

The ".." directory is one back from the one you're currently in. If you're in /home/me/foo/bar and you type "cd .." you'll be moved to /home/me/foo. If you then type "cd ../.." you'll be moved to /home.
 
Old 08-01-2005, 11:22 PM   #3
juanbobo
Member
 
Registered: Mar 2005
Location: Chicago
Distribution: Gentoo AMD64
Posts: 365

Rep: Reputation: 30
It's the number of kilobytes taken up by all of the files in the current directory and its subdirectories. You can use the "-h" flag to show what units the "total" number is givern in.
 
Old 08-01-2005, 11:34 PM   #4
JrLz
Member
 
Registered: Mar 2004
Location: Jakarta
Posts: 164

Original Poster
Rep: Reputation: 30
Quote:
Originally posted by jrdioko
The following is from "man ls" (type "man command" to see information about command):

Code:
When the -l option is given, each list is preceded by a  summary  line giving the total size of all files in the list, measured in semi-kilobytes (512 B).
The "." directory is the one you're currently in. For example, to move the file "foo" in the directory "/home/me" to the directory you're currently in, whatever that might be, type "mv /home/me/foo ."

The ".." directory is one back from the one you're currently in. If you're in /home/me/foo/bar and you type "cd .." you'll be moved to /home/me/foo. If you then type "cd ../.." you'll be moved to /home.
thx man........ I didn't notice that it exists in the man of ls........
I already knew about the "." and ".." , thx anyway.....
but I was guessing that the "ls -l" was counting a folder for 2 (when I mkdir a new dir and do ls -l again) as the counting of the "." and ".." of each folder

I see that it's wrong after the post you've given....
thx for juanbobo too......
is there anyway I can close this topic since it's solved?
 
Old 08-01-2005, 11:42 PM   #5
jrdioko
Member
 
Registered: Oct 2002
Distribution: Debian 6.0.2 (squeeze)
Posts: 944

Rep: Reputation: 30
Ah, I see now what you were saying after rereading your post. Threads aren't normally closed when they're resolved, just leave it the way it is or post some followups if you have them.
 
  


Reply


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
Please can anyone tell me what this means? twysm Linux - Newbie 6 09-15-2004 05:23 PM
What this means? latino Linux - Security 2 08-17-2004 05:39 PM
Can someone tell me what this means? Kramer Linux - Laptop and Netbook 20 09-30-2003 09:18 PM
what does it means dark_light Linux - General 1 07-18-2002 06:58 PM
Could someone please tell me what this means!!!!! brianm Programming 1 03-27-2001 10:05 PM


All times are GMT -5. The time now is 06:38 AM.

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