Questions tagged [du]

"du" is the Linux command for reporting Disk Usage

Filter by
Sorted by
Tagged with
0 votes
1 answer
48 views

du command with -h option modifies the displayed result

trying to understand the basics of du command is not that simple for me . For instance there is this -h option which is defined as printing in "human readable format" . The problem is that ...
mazda's user avatar
  • 135
0 votes
0 answers
45 views

Using ncdu, how to know the number of items in current dir, not total count in childtree

I love using ncdu to browse files in Debian (and also MacOS), yet I can't figure out a way to display the number of items in the current directory, rather than the total amount of files including all ...
Myoch's user avatar
  • 111
0 votes
0 answers
41 views

Why does "nautilus"(Gnome FIles) gives me so smaller size of directory, compared with "du"?

I have compressed a folder and if I right click in the folder and click properties, I get from nautilus (Gnome Files) but instead if I run du (from the branches parent directory): $ du -sh * 292M ...
allexj's user avatar
  • 1
0 votes
1 answer
63 views

Inconsistent du output on /usr

First here is the size of /usr : $ sudo du -sh /usr 6.2G /usr $ When doing a du on the directories at the / and selecting /usr, I get this : $ sudo du -sh /*/ | grep /usr du: cannot access '/proc/...
SebMa's user avatar
  • 1,803
1 vote
1 answer
135 views

2T file system full! du says only 70G consumed. Where is the rest?

When I run df / I get Filesystem Size Used Avail Use% Mounted on /dev/mapper/ubuntu--vg-ubuntu--lv 2.0T 1.9T 0 100% / When I run sudo ncdu -x / I get Total disk usage: ...
vijayvithal's user avatar
1 vote
1 answer
2k views

Synology NAS: deleted files but space won't go down

I've been facing this problem with my Synology lately: I use the Download Station to download torrents in the folder /volume3/video. I now have downloaded 43 files and I can list them running the ...
Francesco Mantovani's user avatar
0 votes
1 answer
1k views

exclude all directories and subdirectories from du/diff command in calculations

I would like to find difference in bytes in files. However, du/diff command with -a list also directories and subdirectories. I want only the files in subdirectories and directories, not these ones. I ...
Estatistics's user avatar
-2 votes
1 answer
70 views

Why does du command show wrong size of log directory?

I'm running: du -h These are the results: 112K ./YaST2/storage-inst 172K ./YaST2/storage-03 56K ./YaST2/storage-02 48K ./YaST2/storage-01 60K ./YaST2/storage 64K ./YaST2/control-...
nintyfan's user avatar
1 vote
2 answers
143 views

How to run xargs utility on all expanded lines of input?

I have a file with a list of files and directories, containing the wildcard *. I am trying to output the size of the entries with du and would like a grand total. If I start with: cat file | xargs du -...
Francisco Leon's user avatar
0 votes
0 answers
167 views

du with --max-depth, only show that depth level directories

With this command du / -d 2 I get listed both depth 1 and depth 2 directories /home /home/john /usr /usr/lib Is there a way to only show max-depth level directories? In the present case just /home/...
João Pimentel Ferreira's user avatar
0 votes
0 answers
36 views

Linux: inconsistency reported by 'du'

xrfang@lky-web-02:/tmp/nnrres/ready$ ls -alh total 249M drwxr-xr-x 2 root root 249M Oct 27 08:29 . drwxr-xr-x 11 root root 4.0K Oct 17 22:35 .. -rw-r--r-- 1 root root 303 Oct 24 13:11 ...
xrfang's user avatar
  • 141
1 vote
1 answer
153 views

Only print terminal directories in "du"?

Is there a generalized solution for getting only the deepest directories? Counting slash characters won't work, because if I change to --max-depth=4, the deepest directories won't all have the same ...
RonJohn's user avatar
  • 261
0 votes
2 answers
3k views

How to check what was moved when using “mv” and the process stops due to permissions issues?

I want to move a folder (test) on our server from /home/data to /home/projects/data. What I did is to use mv. It did not move the folder in the end for some permission problems. However, the folder ...
Laurie1989's user avatar
3 votes
1 answer
325 views

Odd behavior by 'du' with `dd` on a BTRFS disk showing 0 filesize.. Anyone got some clues or thoughts around it?

Been tinkering with btrfs with consideration of moving from ext4 to that. However, when wanting to compare R/W speeds, I seem to have come across an (to me at least) unusual behavior by du on the ...
DhP's user avatar
  • 243
0 votes
1 answer
216 views

Why are df and du command show inconsistent results?

When I run df -h it shows that 95% has been used in /data4 and I am the only user under /data4. Filesystem Size Used Avail Use% Mounted on overlay 591G 455G 136G 78% / tmpfs ...
martin's user avatar
  • 145
1 vote
0 answers
2k views

BTRFS discrepancy between df and du

the difference between disk usage reported by df and du makes 20% of capacity of my drive. It is ubuntu-type btrfs filesystem with @ and @home. Where could be the problem please? df -h /dev/sda2 ...
Jan's user avatar
  • 357
0 votes
1 answer
224 views

Excluding current folder when using du

I'm trying to read the size of the files in a folder using du -ah, but the output keeps showing me the current directory information( . ). I was wondering if there's some flag I can use with du to ...
Oscar's user avatar
  • 13
1 vote
1 answer
764 views

du command not counting some subdirectories

Calling: sudo du -sh /var returns: 0B /var but calling: sudo du -sh /var/log returns: 613M /var/log Why is du not counting subdirectory despite sudo? Also some items gave Operation not permitted ...
Kevin S.'s user avatar
  • 131
1 vote
1 answer
3k views

How can I find out the capacity of the nfs mounted directory on the disk?

I cloud not find files filling the disk. df -h command print out / part usage %86 ( capacity is 15G ) but du -sh / command print out 3G. I am using nfs share on my system. the nfs mounted to /mnt. i ...
Hasan's user avatar
  • 23
0 votes
1 answer
529 views

Why do du -s * and du -s . show vastly different sizes?

I ran both du -sh . and du -sh * inside a directory, but the values returned by the second one don't add up to nearly the same value reported by the first. 5.7GB vs 1.5 GB. Why is this? Are there some ...
The Bic Pen's user avatar
4 votes
2 answers
2k views

du -h returns 512, what does it mean?

I have some files for which du -h returns 512, my understanding it is supposed to return numbers with units. What does it mean ? What is the actual disk space being used ? good file (base) -bash-4.2$ ...
Guddu's user avatar
  • 171
0 votes
0 answers
256 views

DF and DU show different usage, but LSOF shows no deleted files

I'm running Docker daemon on an RedHat host and Docker containers are being built here on a daily basis. After a couple of days the mount point reserved for the Docker daemon (/var/lib/docker) fills ...
Isegrimm's user avatar
0 votes
0 answers
156 views

Where is `shared-du` (`reflink-tools`)?

The OCFS2 manual page describing reflink snapshots describes a tool named shared-du, together with examples. However I'm unable to locate that tool on the web. Where can I find it? Citing from the ...
U. Windl's user avatar
  • 629
0 votes
1 answer
264 views

How to fix du tab alignment?

I'd like to get the du output in neat columns. This is what I get: du -sh * | sort -hr ---- 48M app 11M lib 6.7M image.jpg 1.1M image2.jpg 488K code.c 488K code.py 72K doc.txt 16K notes....
mcp's user avatar
  • 141
3 votes
1 answer
10k views

Is it safe to delete contents of /root/.cache folder to free up space?

I need to free up disk space on my linux server. I run the df command to check space ad see that I'm using up 100% of disk space. myserver:/ # df / Filesystem 1K-blocks Used Available Use% ...
Harry Boy's user avatar
  • 131
1 vote
1 answer
1k views

How to check the directory size using find command?

I would like to list the directories which is having size more than 10MB. I tried the same using find command but find command is not giving result with size and type option. It is working with any of ...
MOBIN TM's user avatar
1 vote
0 answers
81 views

Why `du` output / subdirectory size on disk changes after creating a file in parent directory?

╼ pwd /some/dir ╼ ls ╼ some_script.py --create centos-chroot ╼ ls centos-chroot ╼ du --block-size=1 -s centos-chroot 6320181248 ╼ fallocate -l 36613854208 largefile ╼ ls centos-chroot largefile ╼ du --...
Artalus's user avatar
  • 323
0 votes
2 answers
3k views

How to count total size of directory, and why `du` output differs between copies of directory?

Because I am clearly missing something here: $ cp -a CENTOS-chroot 1 $ cp -a CENTOS-chroot 2 $ cp -a CENTOS-chroot 3 $ cp -a CENTOS-chroot 4 $ du --block-size=1 -s 1 2 3 4 6320304128 1 ...
Artalus's user avatar
  • 323
0 votes
1 answer
5k views

How to calculate exact size of partition and number of inodes to write a directory

I need to write a directory with files (specifically - a Linux chroot) to a file with LVM image on it. The background of task is stupid, but I want to understand what is going on for now. I calculate ...
Artalus's user avatar
  • 323
5 votes
3 answers
1k views

How can I get the output of `du -c` without the word `total`?

I want to get the total size of a directory and all directories inside it. I am using the command du -h -c "$input_variable" | grep total It prints the results and the word total. How do I get the ...
user1555314's user avatar
1 vote
0 answers
233 views

How to view the disk use of a directory ignoring hard links in macOS

Using du -d 0 you can see the disk usage of the directory you're currently in. Hard links are counted as well. I'm looking for the command that does this, but does not count the size of the hard ...
murze's user avatar
  • 171
3 votes
3 answers
2k views

Get the total size of all files of a given extension

I'm trying to get the total size of all the JPEGs in a particular folder, but no amount of combinations of options while piping to du seems to make this work: find -type f -iname "*.jpg" | du -sch ...
Hashim Aziz's user avatar
  • 12.8k
0 votes
2 answers
69 views

Can I give a script elevated file access and run it from my current user?

I have a script (I call it dusort.sh) I use to gauge which files are taking up the most space on my drive in a given folder. It essentially boils down to this: #!/bin/bash du --all --human-readable -...
andykais's user avatar
  • 101
1 vote
0 answers
212 views

"du" command on Windows10 under MSYS2 gives "fts_read failed" error on USB formatted as exFAT/FAT32

I'm currently using MSYS2 on Windows10 and I tried to execute du in the MINGW64 Shell Launcher on a USB formatted as exFAT. Assuming the USB is mounted on /g/, the structure of the USB is pretty much ...
AlbyTree's user avatar
3 votes
2 answers
7k views

google cloud storage: find size of sub-folders with gsutil du?

I want to find the size of my sub-folders at the first depth in Google Cloud Storage. There is the function gsutil du, that is quite similar to du, but with some differences. I am not able to just ...
Matifou's user avatar
  • 141
2 votes
0 answers
245 views

du shows large space but inside directory it doesn't show the space

I've been trying to track down used space with du, and I'm seeing some odd behavior. [root@server01 /]# df -h Filesystem Size Used Avail Use% Mounted on /dev/xvda2 32G 32G 190M 100% / ...
GranitePenguin's user avatar
2 votes
3 answers
5k views

Folder is empty, but du reports high usage

I have a 115GB partition on my hard disk (output of cgdisk /dev/sda is below): Part. # Size Partition Type Partition Name --------------------------------------------------------...
Farzad's user avatar
  • 155
0 votes
1 answer
146 views

Is there a way I can check which block of disk is really used?

I use df and du to check disk usage of centos,then I get different results from these tools. [root@localhost home]# df -Th Filesystem Type Size Used Avail Use% Mounted on /dev/mapper/...
Yvette Yu's user avatar
19 votes
2 answers
4k views

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 ...
Hirurg103's user avatar
  • 313
5 votes
1 answer
910 views

Why does du -b show a different result than stat?

I've recently ran into this problem: find /tmp/tmp33hn25wv -type f -exec stat --format='%s' {} + | awk '{s+=$1} END {print s}' 10420224 du -bs /tmp/tmp33hn25wv 12198004 /tmp/tmp33hn25wv Results ...
wvxvw's user avatar
  • 885
1 vote
2 answers
166 views

Running du on timeshift folders give different results

My goal is to find which files/folders take the most space in a snapshot from the backup tool timeshift but, when using du it yields different results: # du -hs * 18G 2018-09-21_16-14-57 910M ...
Paolo's user avatar
  • 45
1 vote
2 answers
6k views

use du to exclude mounted volumes but check root volume only

I am trying to check my disk usage, because my root volume is full. I'm on Centos 7.5. I thought that giving du the -x flag gets it to ignore mounted volumes. But when I check my disk usage on this ...
user99201's user avatar
  • 171
4 votes
1 answer
3k views

Why is `du` on WSL acting giving a directory size greater than machine memory?

I ran into my question while trying to find out which files on my computer are taking up the most space. Here's the information on the total machine memory, found from Windows Subsystem for Linux (WSL)...
bballdave025's user avatar
0 votes
1 answer
81 views

Unexpected behavior with -h flag passed to du

As long as I've been living in *nix world I've lived under the assumption that when a command accepted a -h flag the only thing I was changing was effectively formatting of a print statement. I don't ...
Slater Victoroff's user avatar
0 votes
1 answer
594 views

Inconsistent output of `du` command

Why is the output of du -sch ./ not identical to du -sch ./* E.g. I ran du -sch in my user's home directory and got 51GB but running du -sch * in the same directory results in 47GB. At first I ...
Aren Tahmasian's user avatar
4 votes
1 answer
2k views

Why does “du -sh” show different folder size after copy?

I want to have a simple backup and copied all files from one folder to another. OS is Debian. When I do a du -shon the source folder I get 436G. When doing the same on the destination I only get 384G....
user3262987's user avatar
0 votes
1 answer
488 views

how to increase the space on docker in CentOS7?

How can I increase the space on this docker? I need to transfer 30G of images into this docker to do the image processing within the docker however seems I only have 2G available $ sudo docker pull ...
Mona Jalal's user avatar
0 votes
1 answer
548 views

Luks encrypted external disk does not have any free space

I have a luks encrypted external disk that worked normally al the time. But suddenly, there is no free space at all. Even when I delete something with rm bigfile there is no freed space. I looked up ...
Jeno's user avatar
  • 437
0 votes
1 answer
40 views

Can I do an inclusive du, as opposed to exclusive?

I need to do a du search that only grabs certain subfolders. For example, here is the directory structure: du -b 0 ./678 21 ./679/536/Content_Repository_PoC_-_Main 73 ./...
CaptainSkyfish's user avatar
4 votes
1 answer
26k views

Excluding folders when doing du

I am trying to use du to get a list of the files/sizes on the filesystem (doing this as sudo): cd / du --exclude-from="/home" and I am getting an error message, telling me that /home is a folder. I ...
EastsideDev's user avatar