Questions tagged [du]

"du" is the Linux command for reporting Disk Usage

Use this when the topic includes the use of the du command which shows disk space usage.

There are many options to this command, and one of the most useful if to use do -sh dirname or do -sh . to see the size of a particular (or current) directory without having it go through and show all the details.

-h means to make it human-readable (i.e. 1GB instead of a long number)

-s means to show just the summary without all the clutter of the component files and subdirectories.

122 questions
155
votes
4 answers

Display each sub-directory size in a list format using one line command in Bash?

I want to get a list of the directories and their sizes in a list format like how you get when you do a ls -l. The thing is that is there a one line command that can do this? I see others have long commands just to output this. That's just too…
143
votes
7 answers

How to analyse disk usage in command line linux?

du and df are nice, but I don't know how to filter the data they provide the way I do with SequoiaView. I would like to know which are the largest folders and the largest files in a glance.
Jader Dias
  • 16,236
100
votes
2 answers

du only for directories

In C-Shell, how can I get the same output as du -sh ./* but without listing the files in the root dir, i.e. just a list of subdirectories in ./ and the sizes of all their contents?
foglerit
  • 1,115
34
votes
8 answers

du which counts number of files/directories rather than size

I am trying to clean up a hard drive which has all kinds of crap on it accumulated over the years. du has helped reduce disk usage, but the whole thing is still unwieldily not due to the total size, but due to the sheer number of files and…
Jesse
  • 843
  • 2
  • 10
  • 16
29
votes
5 answers

How to get the actual directory size (out of du)?

How do I get the actual directory size, using UNIX/Linux standard tools? Alternative question: How do I get du to show me the actual directory size (not disk usage)? Since people seem to have different definitions of the term "size": My definition…
basic6
  • 2,837
27
votes
4 answers

Is it possible to format ps RSS (memory) output to be more human friendly?

Executing ps ux returns a nice list of process information, easy to grep through or watch. However, there doesn't seem to be much flexibility in the memory usage output; the RSS (resident set size) is printed in kB, which for large processes is hard…
metasoarous
  • 698
  • 1
  • 7
  • 10
25
votes
2 answers

Only get the size from "du" command, not the folder names

I am doing an applescript that is supposed to set the size of an folder to an varible. This is the code so far: set sizeVar to do shell script "du -skh -m /Users/JS_Admin/Desktop" Output: "4242 /Users/JS_Admin/Desktop" The thing is that I only…
DevRandom
  • 415
23
votes
1 answer

How to know the directory size in CENTOS

I have a website on my server and I own it. The size of the website is around a whopping 170GB. This shouldn't be this much. At most, it should be around 20GB. I don't know what makes it that big. I am trying to figure out which directory has such a…
Yogus
  • 1,884
19
votes
2 answers

Why is a directory copied with the cp command smaller than the original?

I am tying to copy one directory with a large number of files to another destination. I did: cp -r src_dir another_destination/ Then I wanted to confirm that the size of the destination directory is the same as the original one: du -s…
Hirurg103
  • 313
16
votes
3 answers

Total disk usage for a particular user

I would like to see the total disk usage for myself on a particular file system. I executed the command du -h ~my_user_name However, this lists every directory owned by my_user_name. I would like to get the sum total of all of this information. …
Alex
  • 607
13
votes
2 answers

"du -h" with more decimal places

I'm working on a little util tool written in bash that gives me some information about a game server on Linux. For that reason I need a possibility to display the size of the file contents. I'm doing that right now by using this: du -Lshc * It…
8
votes
3 answers

Difference between df -k and du -sh

df -k /dev/sda6 25396228 21249088 2836240 89% /export 21G used versus du -sh /export 3.4G /export The 3.4G is correct because we have removed all non essential file but free space reported by df is not consistent with the…
7
votes
3 answers

du -x still examines mounted filesystems when using wildcards

If I try du -s -h -x /* it will try to examine all filesystems (real and pseudo) mounted directly under /, e.g. /dev, /proc, /sys, /run, and /home (/home is on an extra partition). I think it comes from the shell expansion of *, giving du a…
Markus N.
  • 585
6
votes
1 answer

Faster du/stat alternative for directories

I have several very big directories and i want to know their estimated size. I use for this purpose mostly du, but it takes for each folder about 3 minutes, so i'm asking if there is an alternative to du or stat that takes less time (it could be…
rwx
  • 239
6
votes
1 answer

Disk space analyzer that can read du output

I'm looking for a GUI program that can parse du output and show both a browseable file tree and a treemap. So far i've tried: xdiskusage, xdu (Linux only, ugly GUI, no tree view) WinDirStat, kdirstat | k4dirstat, GdMAP (no du output…
eadmaster
  • 1,356
1
2 3
8 9