The tag has no wiki summary.

learn more… | top users | synonyms (1)

37
votes
9answers
12k views

how do you sort du output by size?

How do you sort du -sh /dir/* by size? I read one site that said use | sort -n but that's obviously not right. Here's an example that is wrong. [~]# du -sh /var/* | sort -n 0 /var/mail 1.2M ...
36
votes
1answer
1k views

Why are there so many different ways to measure disk usage?

When I sum up the sizes of my files, I get one figure. If I run du, I get another figure. If I run du on all the files on my partition, it doesn't match what df claims is used. Why are there so many ...
28
votes
4answers
19k views

Reserved space for root on a filesystem - why?

I understand that by default, newly created filesystems will be created with 5% of the space allocated for root. I also know you can change the defined space with: tune2fs -m 1 /dev/sdXY What I'm ...
27
votes
3answers
2k views

Why are text files 4kB?

For some reason, when I make a text file on OS X, it's always at least 4kB, unless it's blank. Why is this? Could there be 4,000 bytes of metadata about 1 byte of plain text?
23
votes
5answers
1k views

How to strip a Linux system?

I've been building a Linux distro, and I've stripped the binaries, etc. The system won't use GCC or development tools, as it will be a Chrome kiosk, so it would greatly help if I could strip down the ...
20
votes
3answers
1k views

Can the “du” program be made less aggressive?

We have a regular job that does du summaries of a number of subdirectories, picking out worst offenders, and use the output to find if there are things that are rapidly rising to spot potential ...
18
votes
7answers
4k views

How to understand what's taking up space?

I'm looking for a linux alternative to WinDirStat. I would like to know what is taking up space on my hard drives. A program that works on console and doesn't require a UI is preferred .
15
votes
2answers
3k views

How can I find the number of files on a filesystem?

I want to know how many files I have on my filesystem. I know I can do something like this: find / -type f | wc -l This seems highly inefficient. What I'd really like is to do is find the total ...
14
votes
4answers
542 views

How can I determine if running tar will cause disk to fill up

If I run tar -cvf on a directory of size 937MB to create an easily downloadable copy of a deeply nested folder structure, do I risk filling the disk given the following df -h output: /dev/xvda1 ...
13
votes
1answer
226 views

Why is /dev full?

The /dev.. is full: SERVER:/dev # df -mP /dev Filesystem 1048576-blocks Used Available Capacity Mounted on udev 12042 12042 0 100% /dev There is no ...
12
votes
1answer
6k views

How to remember the difference between du and df?

du and df do rather similar things, and so I always find myself typing the wrong one. I think if I knew what "du" and "df" stands for it might make it easier to remember which to use. What is a way ...
12
votes
2answers
6k views

Do symbolic links actually make a difference in disk usage?

I've read in so many websites that, in Linux, symbolic links (soft links, symlinks) are just like pointers that reference another file, which may be located anywhere (like Windows shortcuts). However, ...
11
votes
2answers
962 views

“ls -lh” reports total size less than sum of individual sizes

Under what circumstances would ls -lh show a total that is less than the sum of the individual files? For example: $ ls -lh /var/lib/nova/instances/_base total 100G -rw-rw-r-- 1 nova nova ...
11
votes
3answers
4k views

Getting size with du of files only

How can I get the size of all files and all files in its subdirectories using the du command. I am trying the following command to get the size of all files (and files in subdirectories) find . ...
10
votes
7answers
34k views

Tell fs to free space from deleted files NOW

Is there a way to tell the kernel to give back the free disk space now? Like a write to something in /proc/ ? Using Ubuntu 11.10 with ext4. This is probably an old and very repeated theme. After ...
9
votes
4answers
3k views

Is there a way of deleting duplicates more refined than fdupes -rdN?

Recently I have the need to delete a lot of duplicates. I am merging three or four filesystems, and I want the space to be used economically. At first, fdupes seemed like it was the best tool for the ...
8
votes
5answers
4k views

How to cache or otherwise speed up `du` summaries?

We have a large file system on which a full du (disk usage) summary takes over two minutes. I'd like to find a way to speed up a disk usage summary for arbitrary directories on that file system. For ...
8
votes
3answers
1k views

Directory size calculation difference

I need to get the size of directory in terminal for signing purposes. I'm using following command: du -s /path/to/dir I'm multiplying the result by traditional UNIX block size (512 bytes) and get ...
8
votes
6answers
6k views

Find biggest files or directories

Which command will print the sizes of all files and directories in the tmp directory (including hidden ones) and sort them by sizes from largest to smallest in human readable format (e.g. 2 GB)? The ...
8
votes
7answers
3k views

Splitting large directory tree into specified-size chunks?

I have a directory tree that I would like to back up to optical disks. Unfortunately, it exceeds the size of any one disk (it's about 60GB). I am looking for a script that would split this tree into ...
8
votes
2answers
1k views

How can I list the top IO consuming files?

My document management software is doing a lot of IO and I would like to know which files it is accessing the most. Is there a Linux tool that would give me the list of the top IO consuming files, ...
7
votes
3answers
348 views

How do you tell what hard drive a file is on?

On Debian, I have multiple hard drives, how do I know where /var/www is? Bonus: How do I check the capacity and consumed capacity and of my drives?
7
votes
6answers
20k views

How do I count all the files recursively through directories

I want to see how many files are in subdirectories in there subdirectories to find out where all the inode usage is on the system. Kind of like I would do this for space usage du -sh /* which will ...
7
votes
3answers
3k views

No space on device when removing a file under OpenSolaris

While trying to mount a NFS share (exported from an OpenIndiana server) on a client box, the OI server crashed. I got the black screen of death, what looked like a log dump, then the system restated. ...
7
votes
3answers
2k views

How can I monitor disk I/O in a particular directory?

I've got a few processes with a known name that all write to files in a single directory. I'd like to log the number of disk block reads and writes over a period (not just file access) to test whether ...
7
votes
3answers
156 views

Harddrive I/O per Pid

is there any way to see the disk I/O per pid/process ? Monitorix shows me the following and correct me if I´m wrong, but it looks like that the harddrive is slowing down the whole system: UPDATE #1 ...
6
votes
6answers
773 views

Which installed software packages use the most disk space on Debian?

Disk space on my root partition is running low, so I want to delete some applications from the system. How can I see which software packages use the most disk space? Is it possible to view that from ...
6
votes
2answers
8k views

Find and remove large files that are open but have been deleted

How does one find large files that have been deleted but are still open in an application? How can one remove such a file, even though a process has it open? The situation is that we are running a ...
6
votes
1answer
2k views

Print size of directory content with tree command in tree 1.5?

I like tree it's a nice way to display my files and the size of folders/directories. But the -h option only shows the size of the directory, not it's contents. /media/ ├── [ 16K] 64D9-E862 │   ├── ...
6
votes
1answer
193 views

why ls reports a huge file and du does not?

When I run arm-none-eabi-objcopy -O binary add.elf add.bin everything seems to be ok. But, later when I run ls -lh add.bin add.elf this is the output I received: -rw-r--r-- 1 david david 2,6G nov 23 ...
6
votes
2answers
2k views

How to `du` only the space used up by files that are not hardlinked elsewhere?

Using rsync --link-dest for space-saving snapshots, how can I figure out how much space I actually saved? Or more general: How to figure out how much space a directory uses considering only files ...
6
votes
2answers
346 views

Mysterious write IO

I am just reviewing the disk IO of a XEN VM server. I stumbled across a DomU that has constant write traffic. To narrow that traffic further down I logged in to the DomU (CentOS 5, 64 Bit) and ...
6
votes
2answers
4k views

df vs. du: why so much difference? [duplicate]

Possible Duplicate: Why is there a discrepancy in disk usage reported by df and du? df says 8.9G used by the partition mounted in / :~$ df -h Filesystem Size Used Avail Use% Mounted ...
5
votes
2answers
1k views

Why is there a discrepancy in disk usage reported by df and du? [duplicate]

I have a Linux(CentOS) server, the OS+packages used around 5GB. Then, I transferred 97GB data from a Windows server to two folders on this Linux server, after calculated the disk usage, I see the ...
5
votes
2answers
895 views

Disk usage summary per user

Is there a way to get the disk usage per user under a given path? du doesn't seem to have an option to aggregate disk usage per user, and df only seems to report how much disk is left on the drive. ...
5
votes
2answers
2k views

Disk space on Fedora 12

I'm using Fedora 12 on my laptop. I have 10GB disk space and 2GB of them are free. After 2-3 days uptime the space ends and I must reboot. After rebooting I get 2GB free space back. How can I prevent ...
5
votes
2answers
726 views

How can I diagnose and repair missing drive space?

I have a small ext3 / partition on a 2T drive which appears to have a discrepancy in its free space. How can I determine what is causing it and how it can be fixed. After trying everything I could ...
5
votes
2answers
444 views

xfs disk usage is 15-30% bigger than the files

xfs seems to use 15-30% more disk space than the files require: # du 0 . # dd if=/dev/zero of=test bs=1M count=5k 5120+0 records in 5120+0 records out 5368709120 bytes (5,4 GB) copied, 10,527 ...
5
votes
1answer
134 views

How to monitor top applications using CPU (and IO if possible) in a graph?

I need to find what and when these applications used so much CPU (and IO if possible too). This should be in a graphic timeline like we see in GNOME System Monitor CPU History. I also want to compare ...
4
votes
2answers
4k views

ext4: How to account for the filesystem space?

I've recently formated a 1.5 TB drive with the intention of replacing ntfs with ext4. Then I noticed that the files I saved don't fit on the new partition. df: ext4 (ext3 & ext2 show the same ...
4
votes
3answers
325 views

du gives two different results for the same file

I am a graduate student of computational chemistry with access to a Linux cluster. The cluster consists of a very large (25 TB) fileserver, to which several dozen compute nodes are connected. Each ...
4
votes
4answers
572 views

DU: only show folders at depth

I'm getting output from du -h like the following: 103M ./.wine/drive_c/windows/mono/mono-2.0/lib/mono 103M ./.wine/drive_c/windows/mono/mono-2.0/lib 129M ...
4
votes
4answers
1k views

Find largest files recursively

There seem to be a lot of entries about how to use du to recursively find the largest dir and files at the same time, but none on how to only recursively find the largest files in a set of ...
4
votes
2answers
425 views

What happened to my free space

On my Amazing 2GB EeePC Surf, I have no more space left! This is quite normal, and it happens every now and then. Just delete a few large, unneeded files and everything should be good, right? So I ...
4
votes
2answers
3k views

How to list ALL directories according to their size? [without including the parent directory]

I have a bunch of random folders, some of them are hidden (beginning with a period). I want to list all of them, sorted by their sizes. I have something on the lines of this in mind: ls -d -1 -a */ ...
4
votes
2answers
258 views

What does `du - hb` do?

With du -bh I think I get the apparent size in human readable format: # du -bh 295K ./test However, I would expect the same from du -hb, but I get something else: # du -hb 301926 ./test I ...
4
votes
3answers
135 views

Sort all directories based on their size

I'd like to sort all the directories/files in a specific directory based on their size (using du -sh "name"). I need to apply this command to all directories in my location, then sort them based on ...
4
votes
2answers
142 views

Why does du report a size of 0 for some non-empty files on a HFS+ partition?

What is the explanation for the difference: $ ls -l /Applications/Safari.app/Contents/Info.plist -rw-r--r-- 1 root wheel 15730 11 jui 15:02 /Applications/Safari.app/Contents/Info.plist $ du -sh ...
4
votes
4answers
281 views

How to find out what is wasting space on “/”?

I can find out what is wasting space with this: du -sm * | sort +0nr | head -30 But what if "/" is filled 100%, and there are many mountpoints, ex.: /foo, /foo2, etc. How can I get a list of ...
4
votes
1answer
75 views

Behavior of `du` command with `-L` flag

I've noticed a strange behavior with du command when it's used with -L command line option. I'm using Slackware 14 and Coreutils 8.19. To reproduce the strange behavior, create two folders: mkdir ...