Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Space left under current directory Post 3204 by Optimus_P on Tuesday 26th of June 2001 11:32:56 AM
Old 06-26-2001
as neo said du is the utility you want.

this script goes to each filesystem and lists the first level directorys in that filesystem by size in kb. use it if you like alter if you wish but its here.

Code:
#! /bin/ksh
#
# This will take a look at all Filesystems NOT left out in the variable FILESYSTEM and
# then find all directoy sizes listed in that filesystem and print them to standard output
# in a formated output. All sizes are in kb.
#
# by: Michael Dooley (dooley.michael@con-way.com)
#
FILESYSTEM=`df -n|grep -v proc|grep -v dev/|awk '{ print $1 }'`

for FS in ${FILESYSTEM};do
        FREE=`df -k|grep $FS|awk '{ print $4 }'`
        USED=`df -k|grep $FS|awk '{ print $3 }'`
        cd $FS
        echo "-=Disk Spaceing Script (all sizes are in kb)=-"
        echo '\t' by: dooley.michael@con-way.com
        echo DISK ${FS}
        echo
        echo TOTAL AVAILABLE $FREE
        echo
        echo USED:
        echo '\t' $FS
        for DIRECTORY in `ls ${FS}`; do
                if [[ -d $DIRECTORY ]]; then
                        du -s $DIRECTORY|awk '{ printf ("%25s\t%-10d\n", $2,$1) }'
                fi
        done
        echo TOTAL USED ${FS}"\t"$USED
        echo
done

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

no space left on device

This seems like it would be a common question, but I didn't find much that helped in a search... I have a script scheduled in my crontab that outputs to /dev/null ie: /dir/scripts/script1 > /dev/null I have recently started getting the error: cp /dir1/dir2/file.xls: No space left on... (1 Reply)
Discussion started by: kristy
1 Replies

2. UNIX for Advanced & Expert Users

no space left on device

I have a SCO UNIX on my Server. When I last tried to shutdown my system, I got an error message “no space left on device”. Now when I try to boot the system again, I just can't and I get the same error message. Please help! (2 Replies)
Discussion started by: anjane
2 Replies

3. UNIX for Dummies Questions & Answers

How much disk space left?

Hi, I need to allocate some space to a particular filesystem. I am Unix newbie ... please tell me how to find out how much disk space I have on a disk. I use df -b to check kb free on the filesystems. Then I thought I would use pvdisplay -v /dev/dsk/c5t2d6 but I couldn't work out how much... (1 Reply)
Discussion started by: gummysweets
1 Replies

4. Solaris

No space left on device

Hi all, A very strange problem I have this morning with my Solaris 8. I have a FS full, I deleted some files but the system doesn't seems to reallocate the free space (I'm using Veritas): df -k : /dev/vx/dsk/dlds02vg/dlds02oralv 4194304 4194304 0 100% /dlds02/lds/oracle ... (4 Replies)
Discussion started by: unclefab
4 Replies

5. Solaris

No space left on device

We are using this function tmpfile() : FILE *tmpfp ; if ((tmpfp = tmpfile()) == NULL) { fprintf(stderr, "%s: ERROR: init_operator(): ", ROUTINE); perror("tmpfile()"); exit(ERR_OPEN); } and the above is raising error : MSMD0603: ERROR:... (3 Replies)
Discussion started by: atiato
3 Replies

6. UNIX for Dummies Questions & Answers

No space left on device

hello all, i have a proc binary that we run on unix environment, and it is generating this error '' tstfile(): No space left on device '' can you please assist on how to narrow down the problem? thanks (4 Replies)
Discussion started by: mjdbouk
4 Replies

7. Solaris

No space left on device but free space and inodes are available...

hi guys, me again ;) i recently opened a thread about physical to zone migration. My zone is mounted over a "bigger" LUN (500GB) and step is now to move the old files, from the physical server, to my zone. We are talking about 22mio of files. i used rsync to do that and every time at... (8 Replies)
Discussion started by: beta17
8 Replies

8. Shell Programming and Scripting

No Space left On Device

Hi, We are trying to sort the 40GB file in unix and getting following error. Error: sort: can't write /var/tmp/stmAAAvsaGfJ.00002929: No space left on device sort -t ',' -k4 $DIR/INF_ff_FULL.dat >>$DIR/Sort_INF_ff_FULL.dat; 2>$DIR/sort_error.log Can you please advise how to... (2 Replies)
Discussion started by: koti_rama
2 Replies

9. Linux

No space left on device when using rm

Hello people I have a small fileserver running busybox (very small linux distro with most essential stuff on it) and I am trying to remove some unused directories on it. When I try this: rm -R test/I get: rm: cannot remove 'test': No space left on devicedf shows: Filesystem ... (8 Replies)
Discussion started by: GTCG
8 Replies

10. Linux

No space left on device while there is plenty of space available

Hello all posting here after scanning the net and tried most of the things offered still no solution that worked when I do : $ df -h Filesystem Size Used Avail Use% Mounted on footmpfs 7.9G 60K 7.9G 1% /dev tmpfs 7.9G 0 7.9G 0% /dev/shm /dev/da1 ... (3 Replies)
Discussion started by: umen
3 Replies
ECHO(1) 						    BSD General Commands Manual 						   ECHO(1)

NAME
echo -- write arguments to the standard output SYNOPSIS
echo [-n] [string ...] DESCRIPTION
The echo utility writes any specified operands, separated by single blank (' ') characters and followed by a newline (' ') character, to the standard output. The following option is available: -n Do not print the trailing newline character. This may also be achieved by appending 'c' to the end of the string, as is done by iBCS2 compatible systems. Note that this option as well as the effect of 'c' are implementation-defined in IEEE Std 1003.1-2001 (``POSIX.1'') as amended by Cor. 1-2002. Applications aiming for maximum portability are strongly encouraged to use printf(1) to sup- press the newline character. Some shells may provide a builtin echo command which is similar or identical to this utility. Most notably, the builtin echo in sh(1) does not accept the -n option. Consult the builtin(1) manual page. EXIT STATUS
The echo utility exits 0 on success, and >0 if an error occurs. SEE ALSO
builtin(1), csh(1), printf(1), sh(1) STANDARDS
The echo utility conforms to IEEE Std 1003.1-2001 (``POSIX.1'') as amended by Cor. 1-2002. BSD
April 12, 2003 BSD
All times are GMT -4. The time now is 01:36 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy