largest size directory in unix


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users largest size directory in unix
# 1  
Old 09-16-2005
largest size directory in unix

I want to find the which directory under a directory occupy the maximum size is there is any command to find please help
# 2  
Old 09-16-2005
Some pointers: check man pages for df and sort. You should be able to figure it out then.
# 3  
Old 09-27-2005
Try du and sort.
# 4  
Old 09-29-2005
Quote:
Originally Posted by odashe
Try du and sort.
Oops.. df and du... really sorry for the mixup!
# 5  
Old 09-29-2005
Quote:
Originally Posted by blowtorch
Oops.. df and du... really sorry for the mixup!
what unix are you using?

check bdf for hp-ux
# 6  
Old 09-30-2005
I use SunOS and HP-UX. I said that I mixed up with df and du: the OP wants to find the directory with the largest size and the code for that is
Code:
du -sk *|sort -nr

I mistakenly told the OP to check man pages for df and sort, while I should have asked the OP to check man pages for du and sort.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to compare if the size of the directory is more than 500MB in unix

I use du -sk command to find the size of the directory but when i use the result of 'du -sk' into if statement its throwing error.. Could u solve with this..? (14 Replies)
Discussion started by: shaal89
14 Replies

2. Shell Programming and Scripting

How to delete some of the files in the directory, if the directory size limits the specified size

To find the whole size of a particular directory i use "du -sk /dirname".. but after finding the direcory's size how do i make conditions like if the size of the dir is more than 1 GB i hav to delete some of the files inside the dir (0 Replies)
Discussion started by: shaal89
0 Replies

3. UNIX for Dummies Questions & Answers

directory size in unix

hi everyone my q is that i want to know what 's the reason behind the direcotry size in unix like if i do ls -ltr in my home directory it will list all the files and directory .. then the size of directory is either 512 or 1024 .. and every directory is containing files in... (2 Replies)
Discussion started by: aishsimplesweet
2 Replies

4. Shell Programming and Scripting

To Find the largest file in the given directory.

Hi Experts, 1. In unix how to list the largest file in given directory. The answer will in single line statement. 2. I have Sun solaris live CD .I try to compile sample c program using "CC compiler".But its shows "cc command not found". Please help on this. Thanks in advance.... (4 Replies)
Discussion started by: kkl
4 Replies

5. UNIX for Dummies Questions & Answers

Best way to find largest files in a directory

What is the best way to find the largest files in a directory? I used du -k|sort -rn |less. I got a results for this. But if I used the following command , I got another result...a different order in the same directory. Why is that? ls -la |awk '{print $5," ",$9}' sort -rn|less. I saw that... (6 Replies)
Discussion started by: Pouchie1
6 Replies

6. Solaris

Largest LUN size in Solaris 10

What is the largest possible LUN size that can be presented to Solaris 10. I've been googling a lot about this. The new EFI lablels (an alternative to VTOC) supports LUNs greater than 2TB. I need to know the upper limit. please help me find it. (4 Replies)
Discussion started by: pingmeback
4 Replies

7. Filesystems, Disks and Memory

find the 5o largest files in a directory

I'm trying to find the 50 largest file in a directory named /sasdb and its' subdirectories. I'm using the find command and a pipe to awk Not sure if I'm actually getting the largest files from this directory and its subdirectories. Here is the code I used... find /sasdb -ls | awk '{print... (8 Replies)
Discussion started by: igidttam
8 Replies

8. Shell Programming and Scripting

file of largest size in pwd

How to find file of the largest size in pwd? (4 Replies)
Discussion started by: rameshparsa
4 Replies

9. Programming

Finding largest file in current directory?

I was hoping to get some assistance with this C program I am working on. The goal is to find the largest file in the current directory and then display this filename along with the filesize. What I have so far will display all the files in the current directory. But, how do I deal with "grabbing"... (1 Reply)
Discussion started by: AusTex
1 Replies

10. UNIX for Dummies Questions & Answers

How can I get the directory size in Unix?

Hi,everyone, Can I use UNIX command to get a directory size in UNIX ? I am developing a software using C in UNIX. How can I get the directory size? Thanks Harry (1 Reply)
Discussion started by: HarryHong
1 Replies
Login or Register to Ask a Question