Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Solaris 7: command equivalent to du

Status
Not open for further replies.

ponetguy2

MIS
Aug 28, 2002
442
US
Hello everyone, I need to clean-up some disk space on one of our servers. However, it's still running Solaris 7. I've never really worked with this version of Solaris. Can anyone suggest which command I should use to check for which file is taking up the most disk space. I usually do a du -akd command, but I can't think of an equivalent.

Here is the script that I run, but would'nt work on Solaris 7 since there is no du.

#!/bin/sh
while true
do
du -akd $1 | grep '\<[0-9][0-9][0-9]\>'
sleep 600
done
 
Just tried du -akd on a Solaris box and it worked fine. which du brings back /usr/bin/du

Any more info?

If no du. Try find and use the -size option to search for files over a certain size.
 
Hello Ken. Did you try du on Solaris 7? du works on Solaris 8 and on.
 
I've got your back Ken. [bigsmile]

ponetguy2, I've got a Solaris 7 system that has [tt]du[/tt].
Code:
deadpool~oracle> uname -a
SunOS deadpool [b]5.7[/b] Generic_106541-14 sun4u sparc SUNW,Ultra-5_10
deadpool~oracle> which du
[b]/bin/du[/b]
deadpool~oracle> du -k .
6       ./.dt/sessions/home
5       ./.dt/sessions/home.old
17      ./.dt/sessions
1       ./.dt/types/fp_dynamic
2       ./.dt/types
<output trimmed>
Either it wasn't installed by whoever set up that system, or it's not in your [tt]PATH[/tt]. Have you tried doing a [tt]find[/tt] on the whole system?
 
If you're looking for the biggest files, you can use [tt]find[/tt] for that too. For example, to find files over 10 million bytes, something like...
Code:
find / -type f -size 10000000c -print
Hope this helps.
 
Oops, make that...
Code:
find / -type f -size +10000000c -print
 
thank you Ken and Sam. I guess du does exist on Solaris 7. i totally forgot about find.

thank you again.
 
Sorry - should have specified that I was talking Solaris 7.

All the same, your covering fire was appreciated Sam!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top