- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- ls -l bytes column for Directories ....
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2003 10:06 PM
01-23-2003 10:06 PM
In the command ls -l, what does bytes column
represent for directories ? For files it shows actual size.
But for directories, what it means, any logic
behind this ?
Thanks
R. Ezhil
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2003 10:15 PM
01-23-2003 10:15 PM
SolutionThe directory 'file' contains the names of the files that are in the directory, and the inode of the file. Since files are assigned blocks (and a directory is a file), and blocks are of limited size, a directory can be assigned multiple blocks when a lot of files are in the directory.
This explains the size of a directory 'file'.
Hope this answers your question.
Rik.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2003 11:54 PM
01-23-2003 11:54 PM
Re: ls -l bytes column for Directories ....
cd /tmp
mkdir example
cd example
ll -d . #you'll see the size of this dir.
integer i=100
while (( i>0 ))
do
touch i
i=i-1
done
ll -d . #you'll see the dir size has increased.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2003 02:32 AM
01-24-2003 02:32 AM
Re: ls -l bytes column for Directories ....
as Rik pointed out the directory holds the name of the files in it. If you change Damiens example a little, you can see that more clearly. Try changing the line
touch i
to
touch ${i}abcdefg
which will create 100 files whose names end in the string "abcdefg".
Then display the content of the examples directory:
# strings .
and you should see 100 lines flashing by. If you then delete the beforementioned 100 files and repeat
# strings .
you will see same 100 lines flashing by. Although the files have been deleted from the directory, their entries in the directory file are not deleted, just marked as "free".
Then touch a new file, e.g.:
# touch flipflap
and repeat
# strings .
and you will see 100 lines flashing by again, this time flipflap has taken one of the "free" entries in the directory. Hence the size of a directory reflects the biggest size it has had in its entire lifetime.
regards,
John K.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2003 02:40 AM
01-24-2003 02:40 AM
Re: ls -l bytes column for Directories ....
eg:
mkdir test
ll | grep test
>>>>>> 96 Jan 24 10:32 test
cp /stand/vmunix* test
ll | grep test
>>>>>> 1024 Jan 24 10:33 test
rm test/vmunix*
ll | grep test
>>>>>> 1024 Jan 24 10:34 test
ll test
total 0