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
Discussions
Discussions
Discussions
Forums
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
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
тАО05-12-2005 03:10 AM
тАО05-12-2005 03:10 AM
I have a question regarding ls -l and du -s *
/home/
ls -l /home
drwxr-xr-x 8
3 05:52
du -s /home
3796
If I have to find the exact size of
Please help
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-12-2005 03:23 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-12-2005 03:27 AM
тАО05-12-2005 03:27 AM
Re: ls -l du
files and (recursively) directories within each directory and file
specified by the name operands.
This is what you want - Kbytes:
du -sk /home/
ls justs list the contents...you could use an awk script to total - but why bother...
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-12-2005 03:28 AM
тАО05-12-2005 03:28 AM
Re: ls -l du
Now, when you say you want the exact size that becomes more tricky.
It's possible to create "sparse" files. For example, suppose you create a file and seek out to offset 1000000 before writing anything.
e.g.
mkdir /var/tmp/mydir
cd /var/tmp/mydir
dd if=/dev/zero bs=1 oseek=999999 count=1 of=mydir
This will create a 1000000 byte file that only uses 1 byte of disk storage (actually 1 block). In this case what is the "true" size. I suggest you run this comand and examine it with both ls -l and du -k. You will get very different results. Which is correct? Both are because they are looking at different things.
If sparse files are heavily used in a filesystem, it is possible to have the total size of the files (as reported by ls -l) much larger than the total size of the filesystem itself.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-12-2005 04:00 AM
тАО05-12-2005 04:00 AM
Re: ls -l du
# du -sk
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-13-2005 01:11 AM
тАО05-13-2005 01:11 AM
Re: ls -l du
/dev/vg01/lvol1 /home
/dev/vg01/lvol2 /home/matthew
/dev/vg01/lvol3 /home/matthew/emc
and you are sitting in /home and don't want the rest to show up use -x option:
du -x .|sort -nr|more
Matthew from Boston
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-16-2005 02:27 AM
тАО05-16-2005 02:27 AM
Re: ls -l du
ls(short list)
du (disk usage)
when you use ls -l need some manipulation
with awk...On the other hand,trying to get
exact size of your dir than you can use
du -ks. -k option means kbytes
i usually use du -ks
and gets what i need...
Good Luck,