![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| getting results after using ps command | yale_work | Shell Programming and Scripting | 11 | 10-07-2008 05:13 PM |
| Iteration through the results from a unix command | deviprasad83 | Shell Programming and Scripting | 4 | 06-12-2008 05:04 AM |
| Setting the Results of a Command to a Variable | stky13 | UNIX for Dummies Questions & Answers | 1 | 02-29-2008 03:00 PM |
| edit results of a find command | grep_whoami | Shell Programming and Scripting | 6 | 10-15-2007 07:16 PM |
| Command for showing IP Address | danhodges99 | UNIX for Dummies Questions & Answers | 7 | 08-23-2002 09:00 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
df and du command showing different results
I recently encountered this on the AIX system
df command showed usage is 100% i.e 1.5 GB while du command showed usage is only 500MB Why are the 2 commands showing different output This command shows usage is 1.5 GB nlxdsm29:deqadm 24> df -k . /usr/sap/DEQ (/dev/vgdeq_1/lv_sap ) : 1560576 total allocated Kb 0 free allocated Kb 1560576 used allocated Kb 100 % allocation used while this command shows usage is just 500MB nlxdsm29:deqadm 28> *du -sk |sort -nr|head -10 457613 data 24285 log 689 work 51 sec Also a process was using space on this directory /usr/sap/DEQ: 12349co(deqadm) 12374co(deqadm) 12358co(deqadm) 12348co(deqadm) My senior told me that may be the process was writing to a file on this directory . The file must have been deleted for freeing up the space but as the file handle was open the space could not be freed up as reflected in df command I could nt understand it . So can anybody explain this different behaviour of commands |
|
||||
|
Your "senior" is right. A deleted file isn't really as long as a process or more are still using it.
You need to wait for these processes to die or even kill them if that doesn't hurt to see the free space made available again. |
|
||||
|
See in Windows you cant delete file which is being accessed
I dont know about Unix As a novice am thinking the file is deleted hence the space is freed up and should be reflected in df command this "process" concept am really not getting can u plz explain as if u r explaining to a Unix newbie |
|
||||
|
A process is a running program.
In windows, you indeed can't delete a file being accessed, which is a major design issue in my opinion. This is one of the reasons why you need to reboot windows that much after administrative actions with which Unix would have stayed up. Under Unix, you can delete a file being accessed. This file disappears from the directory so its content become unreachable. However, the programs that have it open at the deletion time can still read and write data to it until they die and the space is actually freed. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|