The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to trace the big files causing high disk usage ailnilanjan UNIX for Dummies Questions & Answers 1 12-17-2008 11:50 AM
current CPU usage, memory usage, disk I/O oid(snmp) S_venkatesh SUN Solaris 2 12-13-2008 06:19 AM
how can I find cpu usage memory usage swap usage and logical volume usage alert0919 HP-UX 3 12-02-2008 02:38 PM
disk usage rrs Shell Programming and Scripting 1 04-13-2007 03:48 AM
disk usage (df vs du) gfhgfnhhn UNIX for Advanced & Expert Users 8 09-23-2006 08:06 PM

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 07-01-2009
RRVARMA's Avatar
RRVARMA RRVARMA is offline
Registered User
  
 

Join Date: Feb 2008
Location: Bangalore, INDIA
Posts: 34
Thumbs up du - Disk Usage for only files and NOT directories.

Hello,

Could any one help me how to find the Disk Usage for all the files in the running directory and the sub directories without the disk usage of the directory. I mean to say, i need only the file names without the size of the directories.

See, i used this command

du -a .|sort -nr|more

here i'm getting even the size of directories. I need only the files in each directory. Could you help me please. Thanks in advance.

Note: I'm using MP-RAS and i find du -l doesn't work out.

------------------------------------
Like to add some more..

I found that ls -lu gives the files in the order that they were accessed (even if it is read and not modified). I'm trying to find some command or simple logic where i can filter the filenames that are large in size and NOT accessed for a longer duration of time.

Even a discussion or clue will also be appreciated. (but it should be genuine please).
Thanks a lot.

Last edited by RRVARMA; 07-01-2009 at 05:13 AM.. Reason: Adding some more information.
  #2 (permalink)  
Old 07-01-2009
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,643
Let's say you want to see files larger than 100 blocks (block size varies by filesystem but for this example assume 1024 bytes) with an access time older than 15 days.
Code:
find /path/to/files  -type f -atime +15 -size +100 -exec ls -lu {} \;
  #3 (permalink)  
Old 07-02-2009
DukeNuke2's Avatar
DukeNuke2 DukeNuke2 is offline Forum Staff  
Soulman
  
 

Join Date: Jul 2006
Location: Germany, Berlin
Posts: 2,910
you can also use a little script like:

Code:
#!/bin/ksh
for i in $(ls)
do
 if [ -f $i ]
 then
  du -sh $i
 fi
done
exit 0
  #4 (permalink)  
Old 07-09-2009
RRVARMA's Avatar
RRVARMA RRVARMA is offline
Registered User
  
 

Join Date: Feb 2008
Location: Bangalore, INDIA
Posts: 34
got part of it..

Hi,,

I got part of the thing done..

i gave this command..

du -as|sort -nr|more

and got all the files.. in the descending order of the file usage.. that was cool.. now wat i need is to bring them in an order these files were accessed..

thanks a lot for your contribution..
Sponsored Links
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 11:33 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0