List File size

Hello all,
I have a directory filling up. I need to determine the size of the files in the directory. How do I do that, what command should I run when I am in the directory?

Next question, can I expand the partition size?

du -k -a | sort -n

Or

find . -type f | xargs du -k | sort -n

What platform are you on?

What is your filesystem?

Do you have unallocated disk space?

Sorry, Solaris 8.

And I am not positive about unallocated disk space yet. I am taking over for someone that put this server together and I am unsure the configuration.

Well, there is growfs(1M) but whether you can use it or not depends on your disk layout. Actually, I don't know if growfs is even available on Solaris 8 :slight_smile:

List files from smallest to largest:

ls -l /path/to/dir | sort -nk5

Linux:

du -csh /path/to/dir/*

More General:

du -sk /path/to/dir/*

To clean up, you'll probably use find, maybe something like -

find /path/to/dir -type f -mtime +31 -exec rm -f {} \; -ls
find /path/to/dir -type f -mtime +10 -exec gzip -f {} \; -ls

komputersman,

I found this sticky on this forum, think you might find it useful:
http://unix.com/showthread.php?t=25840

You are all awesome, thank you for the help.

I need to find out what drive this directory is on, such as hda3 or hda4, what command would tell me that? fdisk -l tells me my drives but not whats on them directory wise?

Thank you.

It's the first column in the output of:

df -k /path/to/dir

-c

Awesome, this helped.

Thank you