The tag has no wiki summary.

learn more… | top users | synonyms (2)

45
votes
9answers
16k 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 ...
42
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 ...
32
votes
4answers
22k 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 ...
28
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 ...
21
votes
7answers
6k 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 .
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 ...
15
votes
4answers
617 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 ...
15
votes
2answers
4k 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 ...
13
votes
1answer
331 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
7k 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
7k 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
7answers
43k 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 ...
11
votes
2answers
1k 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
5k 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 . ...
11
votes
3answers
14k 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 ...
10
votes
6answers
23k 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 ...
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
5k 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
1answer
3k 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 │   ├── ...
8
votes
3answers
349 views

Why does fstab use UUID instead of the actual file system name?

For example, this is the first line of my /etc/fstab: UUID=050e1e34-39e6-4072-a03e-ae0bf90ba13a / ext4 errors=remount-ro 0 1 And here's the output of df -h command (reporting free ...
8
votes
6answers
7k 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
4k 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
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
3k 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
269 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 ...
7
votes
4answers
6k views

Finding files that use the most disk space

Is it possible to list the largest files on my hard drive? I frequently use df -H to display my disk usage, but this only gives the percentage full, GBs remaining, etc. I do a lot of data-intensive ...
6
votes
5answers
231 views

Get filesystem name and usage with `df -h`

df -h | grep test | sed -e 's/*%.^ //g;s/.*[ ^I]//' Output: /test /test/drv0 /test/drv1 df -h | grep test | cut -d '%' -f1 | sed -e 's/*%.^ //g;s/.*[ ^I]//' Output: 10 20 15 I want to ...
6
votes
6answers
1k 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
1answer
222 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
375 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
6k 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
2k 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
1k 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
4answers
2k views

How to recursively find the amount stored in directory?

I know you are able to see the byte size of a file when you do a long listing with ll or ls -l. But I want to know how much storage is in a directory including the files within that directory and the ...
5
votes
1answer
2k views

Updating disk free size without rebooting the host

I use RHEL4 with LVM2 on it. At times even after removing large files more that a GB the partition size is not getting updated when is see using df command. -bash-3.00$ df -h Filesystem ...
5
votes
1answer
1k views

Getting disk i/o statistics for single process in Linux

I need to monitor the I/O statistics of a process that writes to disk. The purpose is to avoid write rates too high for long periods. I know there's iostat tool to accomplish this task on a ...
5
votes
2answers
259 views

ext3 Filesystem shows full to most apps, but only 77% full to DF

Var is showing as full to many apps like Nagios, Puppet, and the LVM tools (pvs, vgs, etc) df -h output 6.0G 4.3G 1.4G 77% /var vgs output /var/lock/lvm/V_rootvg:aux: open failed: No space ...
5
votes
2answers
795 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
1answer
173 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 ...
5
votes
2answers
487 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 ...
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
800 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
1k 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
2k 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 ...