Questions tagged [du]
The du tag has no usage guidance.
73
questions
1460
votes
39
answers
1.2m
views
How can I sort du -h output by size
I need to get a list of human readable du output.
However, du does not have a "sort by size" option, and piping to sort doesn't work with the human readable flag.
For example, running:
du | sort -...
45
votes
7
answers
58k
views
du vs. df difference [duplicate]
I have a fileserver where df reports 94% of / full. But according to du, much less is used:
# df -h /
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 270G 240G 17G 94%...
37
votes
4
answers
30k
views
What is the difference between du -h and ls -lh?
I am having a difficult time grasping what is the correct way to read the size of the files since each command gives you varying results. I also came across a post at http://forums.devshed.com/linux-...
28
votes
3
answers
25k
views
FreeBSD: How to know real file size on zfs with compression on?
I'm using zfs on my FreeBSD 9.0 x64 and pretty happy with it, but I find it hard to count directory real, not compressed, size.
Surely I can walk over the directory and count every file size with ls,...
17
votes
1
answer
21k
views
Disk space usage doesn't add up with df & du
I'm trying to free up some disk space - if I do a df -h, I have a filesystem called /dev/mapper/vg00-var which says its 4G, 3.8G used, 205M left.
That corresponds to my /var directory.
If I descend ...
14
votes
4
answers
44k
views
du command takes WAY too long to run
I am running du -sh in a variety of directories to find disk hogs. I got two identical servers (Dell PE2850s), both with RHEL5 and it will take significantly longer to run du on one server over the ...
9
votes
1
answer
9k
views
Ubuntu server: hard drive always full
I have a 50GB vps
when I run df I get
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda1 49982172 46580100 863064 99% /
none 507212 ...
8
votes
4
answers
14k
views
How to do "du" on all files under a directory in linux?
This is what I tried:
[demo@ ~]# ll /usr/local/apache2/logs/|xargs |du -hm -
du: cannot access `-': No such file or directory
I want to see the amount of space each file occupies in m unit.
How to ...
7
votes
1
answer
12k
views
What is right way to show folder usage in megabytes [closed]
I'm using du -bs to count folder size.
du -bs /folder
Result is 96342835 in Bytes... so in MB is it (/1024/1024) 91,87MB.
OK, but when I use
du -hs /folder
Result is different. 99MB
Or
du -s ...
6
votes
6
answers
6k
views
Get Size of All Folders in Directory
I want to get the size of all directories within a specific directory. I was thinking something like
find . -type d -exec du -sh {} \;
But that returns all directories recursively. How can I limit ...
6
votes
3
answers
2k
views
Understanding the different directory sizes
When comparing
root@debian:~# du -s /backup/test1/
5605364 /backup/test1/
two directories with du,
root@debian:/etc/init.d# du -s /data/test1/
5605360 /data/test1/
du tells me that there is a ...
6
votes
1
answer
13k
views
Why does df -h still show 100% full even after deleting files?
The disk space on my Ubuntu web server, running on DigitalOcean, seems to be full. I have already found and deleted the large log file and restarted Nginx. However, it still seems like there is a ...
6
votes
2
answers
3k
views
inconsistency between du -sh and df -h
I know this is a common occurrence when the result of du -sh is smaller than that returned by the file system with df -h. (Because some files are still open in processes etc..) But in my case I have ...
5
votes
1
answer
10k
views
How to output all files/folders ordered by size, including hidden ones
How can I output all files/directories, ordered by size, including hidden ones
(those whose name starts with a dot), all in one go?
By size of a directory, I mean the sum of all file sizes in the ...
5
votes
4
answers
3k
views
Disk full on linux server, blocks used is much less then blocks avalable
Output of df is:
[root@backup log]# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/VolGro 1889811408 1861658948 0 100% /
/dev/sda1 101086 ...
5
votes
2
answers
171
views
Next-gen filesystems: disk space usage log? [closed]
From time to time I run into problems when server hard disks (Linux) fill up quickly with lots of small files. When this happens I have to try to figure out how much space is being taken up and where ...
4
votes
3
answers
1k
views
du -sh * show significant more used space that ls -lah
I am having trouble with running out of diskspace of one of my clients servers.
The output of the commands ls -lah in /var/lib/mysql shows:
drwx------ 2 mysql mysql 16K Dec 30 2015 database_xyz
...
4
votes
1
answer
13k
views
Ubuntu "No space left on device" for /home, df shows 100% full, ds shows much, much less [duplicate]
Possible Duplicate:
Linux different size for df and du for root partition
On an Ubuntu 12.04 server, normal users can no longer create or add to files in /home, encountering a "No space left on ...
4
votes
1
answer
5k
views
The file and dir sizes of du -hs * is not consistent with du -hs
When I run the bash command du -hs ., the output is
1.2G .
When I run the bash command du -hs *, the output is
108K action
4.0K activate.php
8.0K browse.php
584K captcha
164K ...
4
votes
1
answer
9k
views
No more space on FreeNAS 9.3. But only half of space actually in use based on "du -sh" command
This morning I got a warning on my FreeNAS 9.3 machine about "Not enough space"
warning: The capacity for the volume 'SeanVolume' is currently at 85%, while the recommended value is below 80%.
It's ...
4
votes
1
answer
2k
views
Near 100% disk usage, df and du show very different results, lsof not the answer
The issue is that my CentOS 5.8 machine is telling me that I am nearly out of disk space when I am pretty confident this is not the case. I've done a fair amount of researching on this issue and have ...
3
votes
3
answers
93
views
du displaying old results
I ran du -hs to find out how big my /home/user directory was and it reported as 18G. I cleared out almost 4G of data and ran du -hs again to find out how much space I actually saved and it still ...
3
votes
1
answer
2k
views
How can I calculate the total size of an extremely large number of files with a particular extension?
I've got a directory in Linux that contains a large number of files (tens of thousands), plus directories that may contain thousands of files as well.
At some point the following du command fails ...
3
votes
1
answer
347
views
How do I find the biggest files on multiple servers and sum up their size?
I am trying to find the biggest files in the /export/home directory and add up (sum) their sizes.
Script:
#!/bin/bash
filename=hostnames
> export_home.log
while read -r -a line
do
hostname=${...
3
votes
2
answers
861
views
Monitoring of disk usage over time - check for large variations [closed]
I'm looking for a tool that would monitor disk usage over time. What I'm looking for is folders or files that grow unexpectedly over a short period of time.
I use du , ncdu, baobab (when X is ...
3
votes
1
answer
78
views
Folder's taking up way more than it should
My server is chugging along with a 5GB drive, and unfortunately, it's 100% full. Going to delete some files, I notice that my Dropbox's taking up way more than it should. du -hs * returns:
[excel@...
3
votes
2
answers
520
views
df shows bad information on partition usage
I've tried to deal with this for days now with no luck. In this forum and also in other ones I can see a lot of discussion about this but none of the solutions have worked for me.
My current ...
2
votes
3
answers
6k
views
How to find largest files in a dir - ignoring directory sizes
I want to do something like this
du -a | sort -rn | head
But I want to extract files only, ignoring directories.
To be clear, I want to traverse through all sub-directories but I don't want to find ...
2
votes
2
answers
3k
views
df -h disk usage of empty disk shows 188M usage ?!
I have an empty disk mounted as /data
The df -h shows me that 188M are used while a du -h shows me 4,0K.
root@marc:~# du -h --max-depth=1 /data
4,0K /data
root@marc:~# df -h
Sys. de fichiers ...
2
votes
2
answers
5k
views
Why is DU causing high CPU usage?
On CentOS 6.5, du -sk /home and sh -c (du -sk \/home) 2>/dev/null run because a scheduled disk usage for /home, but du is causing 100% CPU usage. Plus, before it's even finished, another du gets ...
2
votes
0
answers
99
views
df differs from du a lot, nfsd service seems matter
I know there have been a lot of discussion on the df/du discrepancy topic. But here I’d post a special issue and ask for some hints.
here is the detail( with a hardware raid5 with 6 sas disks)
system ...
1
vote
4
answers
3k
views
Cross-platform, human-readable, du on root partition that truly ignores other filesystems
Edit 09/20/2012
I made this way too complicated before. I believe that these commands are actually the simpler way, while still formatting everything nicely.
RHEL 5
du -x / | sort -n |cut -d\...
1
vote
3
answers
3k
views
How to find which folder is eating space fast? [duplicate]
I am running Linux server, we using this server as a samba share drive. From yesterday suddenly, one of the share drive size getting increasing (~ 100 MB every ten min). There are too many folders and ...
1
vote
2
answers
5k
views
How to limit du output to a specific user?
I need to help a specific user, say alice, free up some disk space; but not all the user's files are in his home directory; many are in directories shared with other users. I'd like to have something ...
1
vote
1
answer
2k
views
I can't find the ghosts taking up space on my hard drive [duplicate]
Possible Duplicate:
How do I find out what is using up all the space on my / partition?
No Free disk space
$df -h
returns
/dev/sda1 16G 16G 0 100% /
tmpfs ...
1
vote
1
answer
3k
views
Different output by df and du [duplicate]
I have an old RHEL 5.5 Box,
When I fire df -kh I see that /var is of 49 GB with 100 % usage.
But then I go inside the /var
cd /var
and I fire
du -kh
I see that only total 300 MBs are used.
I ...
1
vote
1
answer
148
views
Server was ok for space on /, ran du -s, now server is at 100% usage on /
Our server running RHEL 4 apparently ran out of space today. It was working fine and I decided to run a du -s on an unused directory of files to see how much space we would free deleting it. Upon ...
1
vote
1
answer
330
views
why are du -b and du -k different so much
I am using Ubuntu 16.04.5 LTS, and the version of du is 8.25. Now I have a question:
$ du -b /var/log/lastlog
69788251412 /var/log/lastlog
the size matches command ls -al.
While I use du -k, it has ...
1
vote
1
answer
592
views
(rsync on) mounted volume: hard links seem to be preserved, but space calculated as full files
I'm trying to set up a space-efficient rotating backup scheme with rsnapshot / rsync from a server to a Hetzner storagebox. I'm having a hard time understanding how hard links on the destination are ...
1
vote
1
answer
451
views
speeding up du (maybe use ncdu) for backups with hard links
du -hc --max-depth=1 /home/back/tvppclientarea/ | sort -k2
To show the size of backup directories that use rsync and hard links. The command lists each directory and shows the amount added to the ...
1
vote
1
answer
209
views
Dir size increases after rsyncing to a different machine with same configuration
Have a MySQL (percona, 14.14 Distrib 5.6.28-76.1) machine with a 1TB SSD hosting around 712Gb of mysql data. MySQL has 4 databases, with, say database1, taking major space, 656Gb. Lets call this ...
1
vote
0
answers
192
views
What accounts for mystery hard drive space gone missing? (Difference between df and du)
To preface: there are lots of other useful questions (e.g. this and this) on possible causes for different sizes reported by df and du. None of the explanations apply to my exceedingly simple case, ...
1
vote
0
answers
216
views
Why does `du` on CentOS 7 show 1 value, but it shows a different value on CentOS 8?
I just finished migrating a mail server from CentOS 7 over to CentOS 8.
The mail store was in /var/vmail.
The data was migrated with rsync:
rsync -rltDPH /var/vmail/* root@new-hostname:/var/vmail/
I ...
1
vote
2
answers
4k
views
logrotate status files extremely large
Apache2 on an Ubuntu 16.04 box was showing issues on the websites it's hosting. It was at 100% capacity. Looking further with du, The majority of the ~100gb hard drive was filled by two files in /var/...
1
vote
0
answers
858
views
finding directory size on linux with du reports errors when files are deleted during command
I'm trying to find out the directory size of a folder to determine if a user has rights to keep writing to the folder (i.e. they are within the given limits I've imposed).
I'm doing:
du -sb <path&...
0
votes
4
answers
2k
views
Linux du and rsync 100% disk utilization
Whenever I run du -sh or rsync I get my disk utilisation at 100%. This causes mysql slow queries to appear, which usually causes my site going down.
Any tips or tricks running these to commands ...
0
votes
2
answers
4k
views
Disk usage (du) displays TB not MB
I have an issue while running du that it does not display the usage in units of Megabytes (as expected with -m switch) but TB:
$ du -mhs /mnt/b
2.0T /mnt/b
How can I get a more granular result?
0
votes
3
answers
1k
views
Map linux folders by size
I have AWS linux instance, Currently there are many folders in the instance.
I would like to map all the folders and their size, so i could come back in 1 month and check which folder occupy high ...
0
votes
2
answers
2k
views
df -h shows / is 100% but du -sh * is not showing where the utulization is [duplicate]
OS: Oracle Linux 7.5
df -h keeps showing that / is 100% full but searching on / with du -sh * is not showing where that utilization could possibly be, any help and suggestions will be appreciated. I ...
0
votes
1
answer
2k
views
Find what is using disk space in CentOS 7 (du vs df vs lsof)
I have a server, CentOS 7, that show disk usage on DF way higher than you can see on DU and I trying to understand why
DF shows 38GB used
DU shows 14GB
There is no mount point on any folder
Checking ...