Deleting Files and Clearing Diskspace


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Deleting Files and Clearing Diskspace
# 1  
Old 12-15-2010
Deleting Files and Clearing Diskspace

Hi,

On our servers I have been removing files to clear up some diskspace.

If I do an ls -ltr command I can see a folder with quite a lot of data in it.

When I've gone into this folder and cleared it up, I go back to the previous directory and do another ls -ltr command and the filesize hasn't changed.

For example..

In my /var folder
Code:
drwx------   5 root     root        8192 Jan  9  2004 lost+found
drwxr-xr-x   2 root     bin          512 Jan  9  2004 nfs
drwxr-xr-x   2 root     bin          512 Jan  9  2004 news
drwxr-xr-x   2 root     sys          512 Jan  9  2004 inet
drwxr-xr-x   2 root     sys          512 Jan  9  2004 audit
drwxrwxr-x   3 lp       lp           512 Jan  9  2004 lp
drwxr-xr-x   2 root     sys          512 Jan  9  2004 nis
drwxr-xr-x   2 root     sys          512 Jan  9  2004 ldap
drwxr-xr-x   3 root     sys          512 Jan  9  2004 ntp
drwxr-xr-x   5 root     sys          512 Jan  9  2004 dmi
drwxr-xr-x   4 daemon   daemon       512 Jan  9  2004 statmon
drwxr-xr-x   3 root     root         512 Jan  9  2004 crash
drwxr-xr-x   8 root     bin          512 Jan  9  2004 apache
drwxr-xr-x   7 uucp     uucp         512 Jan  9  2004 uucp
drwxr-xr-x   3 root     bin          512 Jan  9  2004 yp
drwxr-xr-x   3 root     sys          512 May 31  2005 snmp
drwxrwxrwt   4 root     bin          512 Aug  9  2005 preserve
drwxr-xr-x   7 root     sys          512 Jan 23  2007 opt
lrwxrwxrwx   1 root     other         15 Feb  8  2007 spool -> /varspool/spool
lrwxrwxrwx   1 root     other         11 Feb 22  2007 mqm -> /newvar/mqm
drwxr-xr-x   4 root     bin          512 Feb 23  2007 saf
lrwxrwxrwx   1 root     other          5 Oct  3  2008 sadm -> /sadm
drwxr-xr-x   2 root     sys          512 Mar  2  2009 cron
drwxr-xr-x   3 root     bin          512 Oct 30 19:00 ld
drwxr-xr-x   2 root     other        512 Nov 18 13:12 VRTSralus
drwxr-xr-x   4 root     sys          589 Nov 18 13:12 run
drwxrwxr-x   6 root     root         512 Nov 18 13:13 dt
drwxr-xr-x   5 root     sys          512 Dec 12 03:10 log
drwxrwxr-x   8 root     sys         2048 Dec 15 00:01 adm
drwxrwxrwt   2 root     mail       26112 Dec 15 11:30 mail
drwxrwxrwx   8 root     sys      1193472 Dec 15 11:30 tmp

The tmp folder has quite a large filesize.

When I go into tmp I can see the following
Code:
-rwxr-xr-x   1 27973    staff      29217 Feb 22  2005 se3kxtr
-rw-r--r--   1 27973    staff       9126 Feb 22  2005 README
-rw-------   1 root     other      40960 Aug 31  2005 se3kxtr.032.tar
-rw-r--r--   1 oracle   oinstall   62327 Oct  7  2005 reportuser.sql
-rw-r--r--   1 oracle   oinstall   16374 Oct  7  2005 reportviews.sql
-rw-r--r--   1 oracle   oinstall   14135 Dec  8  2005 us1702
-rw-r--r--   1 oracle   oinstall   21890 Dec  8  2005 tcps1702
-rw-r--r--   1 oracle   oinstall   23978 Dec  8  2005 tcp1702
-rw-r--r--   1 oracle   oinstall     615 Dec  8  2005 ntcontab1702
-rw-r--r--   1 oracle   oinstall     620 Dec  8  2005 nnfgt1702
-rw-r--r--   1 oracle   oinstall     379 Dec  8  2005 nautab1702
-rw-r--r--   1 oracle   oinstall    1656 Dec  8  2005 naetab1702
-rw-r--r--   1 oracle   oinstall   16918 Dec  8  2005 beq1702
-rw-r--r--   1 oracle   oinstall    3159 Dec  8  2005 tns1702
lrwxrwxrwx   1 oracle   oinstall      16 Dec  8  2005 raw1702 -> /var/tmp/net1702
-rw-r--r--   1 oracle   oinstall    2946 Dec  8  2005 on1702
-rw-r--r--   1 oracle   oinstall   24121 Dec  8  2005 ldap1702
-rw-r--r--   1 oracle   oinstall    4316 Dec  8  2005 host1702
-rw-r--r--   1 root     other      14468 Oct 25  2006 install_it_Sun_StorEdge_SAN.log
drwxr-xr-x   2 root     other        512 Jan 23  2007 6130SUPPORTDATA
drwxrwxrwx   5 root     other        512 Oct  8  2007 vxif
-rw-rw-rw-   1 process  other      36333 Apr  3  2008 daa4YaWKG
-rwx------   1 mqm      mqm         7786 Jun 11  2009 install.sh
-rw-------   1 uucp     uucp        1024 Jul  6  2009 eaAAAkvaqOl
-rw-rw-rw-   1 process  other          0 Dec 15 11:18 vgaCLaa0T

The total of all the filesizes adds up to 333388 and not 1193472 as the directory appears to be in the /var folder.

Can any explain what is happening?
# 2  
Old 12-15-2010
You're looking at the directory file, not at the size of the files under that directory.
You could use a different command:

HTML Code:
bash-2.03$ ls -ld /tmp
drwxrwxrwt  22 root     sys         7250 Dec 15 12:30 /tmp
bash-2.03$ du -ks /tmp
382912  /tmp
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Allocate diskspace AT&T SV R4

# Hello -all, I have a problem with the SV R4 install. During the floppy2 procedure I get the message that I allocated less than 35 Mb for UNIX. It's a clean install, no other OS. Just a clean PC with a 40Gb disk. I get the # prompt telling me to restart the installation to allocate more Mb's..... (2 Replies)
Discussion started by: raylier
2 Replies

2. Shell Programming and Scripting

Bash script deleting my files, and editing files in subdirectories question

#!/bin/bash # name=$1 type=$2 number=1 for file in ./** do if then filenumber=00$number elif then filenumber=0$number fi tempname="$name""$filenumber"."$type" if (4 Replies)
Discussion started by: TheGreatGizmo
4 Replies

3. Shell Programming and Scripting

DiskSpace Error

Hi, While am preparing the script for diskspace for different partitions different threshhold limit. am getting below error: ./test.sh: syntax error at line 5: `space=$' unexpected Script ==== #!/bin/sh df -h |grep -v '/oradata2'|grep -v '/orabkp' |grep -v '/oradata5' | awk '{ print $5... (7 Replies)
Discussion started by: Pavan83
7 Replies

4. Shell Programming and Scripting

[ask]elimination with diskspace

dear all, i want elimination file with disk space for example: $ df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/VolGroup00-LogVol00 62G 19G 41G 31% / /dev/sda1 99M 13M 82M 13% /boot tmpfs 1014M 0... (2 Replies)
Discussion started by: zvtral
2 Replies

5. Shell Programming and Scripting

AIX system.... deleting files in remote directory after retrieving files

Hi Friends, I am new to this , I am working on AIX system and my scenario is to retrive the files from remote system and remove the files from the remote system after retreving files. I can able to retrieve the files but Can't remove files in remote system. Please check my code and help me out... (3 Replies)
Discussion started by: vinayparakala
3 Replies

6. Solaris

graphical diskspace analyzer

Hi all, recently I took over the admin task for a solaris 5.10 machine. Being a little bit familiar with debian systems Solaris is up to now a complete mystery to me. The first thing I would like to have is a graphical diskspace analyzer. I mean something like BaoBab under gnome. I there a... (2 Replies)
Discussion started by: sly_dunbar
2 Replies

7. Shell Programming and Scripting

ASM Diskspace

Hi I want to check Oracle ASM disk status through a PERL script. Script flow would be like this ... 1. Its taking diskgroup name in the command line... 2. Connect to Oracle database 3. If connection error send a critical message. Plz replyyyyyyy...... (1 Reply)
Discussion started by: Harikrishna
1 Replies

8. Shell Programming and Scripting

to compute diskspace

Guys, have any idea for the script like this? also to compute w/ decimal. thanks a=10 b=20 c=30 d=40 if a < b then ( a -b)*1024 = free space b + (c -d) = total space if a > b then (b / d)*1024 = cpu (3 Replies)
Discussion started by: kenshinhimura
3 Replies

9. UNIX for Dummies Questions & Answers

Diskspace

Hi there, pls help me, i have a problem, how i can find out the disk amount of each harddisk per command (not the on label on the Harddisk) i need it on HP UX and Sun. can anybody helb me???? pls thanks Scotty (1 Reply)
Discussion started by: scotty
1 Replies

10. UNIX for Dummies Questions & Answers

diskspace usage info

Anybody can help me? I need to know a specified folder diskspace usage, that's how much bytes that folder and its files/folders below spend on my storage. Thanks (2 Replies)
Discussion started by: nusajunus
2 Replies
Login or Register to Ask a Question