Questions tagged [du]
du is the standard Unix/Linux command to measure disk usage. Use this tag for questions specifically about the use of the du program.
44
questions
0
votes
0
answers
21
views
I want df to return the space I want to simulate for a folder
I have a folder /backup whose df -h /backup output shows 200G available space, as I want 0 GB available and I dont want to add that much data in /backup folder. How can I achieve this? I dont want to ...
3
votes
1
answer
1k
views
Sort files and folders in ascending order of size
How can I use du -h to sort the displayed files and directories in ascending order of size?
0
votes
0
answers
103
views
How to clean /dev/nvme0n1p3/? [duplicate]
My Ubuntu 22 is showing full disk used.
See that /dev/nvme0n1p3 875G 824G 6.9G 100% /?
But how do I cd into that?
Due to this disk being full, my server is affected, several services have stopped ...
0
votes
0
answers
56
views
How can I use C-n and C-p as shortcut in ncdu
I am using ncdu - NCurses Disk Usage on a Linux server node through CLI.
OS: Ubuntu 20.04.6 LTS , Kernel: Linux 5.11.0-43-generic
ncdu 1.14.1
I get used to Emacs keybindings and I never use arrow ...
0
votes
1
answer
2k
views
Why do `ls` and `du` commands show a different size for the same file? [duplicate]
I am currently using Ubuntu 20.04.
When I check a file's size using the du command, I get the following output:
ubuntu@ip-172-31-49-39:/myxfs$ du -h newquota
4.0K newquota
With the ls -la command, ...
0
votes
0
answers
659
views
Deleting files does not free up the space
I am getting No space left on device error when I run git pull.
This is output of my df command:
$ df -h
Filesystem Size Used Avail Use% Mounted on
udev 7.8G 0 7.8G 0% /dev
...
2
votes
2
answers
389
views
df -h shows 2TB external HDD is almost full but the output for 'du' does not add up
The system that I am using has 18.04 (no dual boot). I have a 2TB Seagate external hard drive which I use for taking the backup of my Ph.D. data. I use rsync -rtvhP to take backups. Recently during ...
0
votes
1
answer
76
views
How to list disk usage by directory, excluding certain output
I am trying to get a sense of disk usage and I want to exclude the ones I cannot access like this - any suggestions?
sudo du -h / --max-depth=1 | grep -v "cannot access"
Thanks.
1
vote
2
answers
2k
views
du, df showing inconsistent hard drive usage
Ubuntu 20.04
1T built-in drive
5T Seagate Basic external USB drive
Yesterday I moved a very large postgres database to an external USB drive, and then deleted the database directory from the main hard ...
3
votes
3
answers
6k
views
How to make `ncdu` show a quick summary of disk usage and exit?
I'd like to make the ncdu NCurses Disk Usage tool analyze a path, display the output, and exit, for scripting purposes. Normally it is a human-interactive tool, but I'd like to remove the human-...
-2
votes
1
answer
292
views
Getting the total size of my five largest files in bash
I am trying to get the total size of my five largest files found in a directory but I am not getting du to work on my list. I have two ways of finding and sorting, the five largest files.
#!/bin/bash
...
0
votes
1
answer
545
views
Find Largest Directories/Files when Drive is Full [duplicate]
When the drive of an Ubuntu 20.04 server is full, how can we find out the directories/files with the largest sizes, ranked from largest to smallest? This can allow me to find some files to delete (...
1
vote
1
answer
416
views
Keep running out of space, where have my harddrive space gone?
I'm kind of a Linux noob and have been for almost 15 years, but I am trying to keep it active and learn more.
I have a Intel NUC with 120-ish NVMe SSD storage which I'm using for a home server. It has ...
0
votes
0
answers
365
views
Why is my filesystem size larger than the partition size. (df vs fdisk)
So...
I get that fdisk lists partition sizes, and df lists filesystem sizes, and that filesystem may use a portion of the partition and disagree on the size, but why would df list filesystem sizes ...
0
votes
0
answers
1k
views
df, du, xfs_quota shows three different disk usage on xfs partition
I have an Ubuntu 18.04 server which is used by a backup software as a storage. The backup software saves the data to a xfs partition (/backup) which is on RAID5. The root filesystem is ext4.
When I ...
1
vote
1
answer
471
views
How to find out the size of recently downloaded files?
I have installed a bunch of development packages from the Ubuntu repositories today, and some of them seem to have had massive amounts of dependencies.
Out of curiosity — and to notify those who read ...
0
votes
1
answer
3k
views
du reports wrong folder size [duplicate]
I am seeing some very strange results when using du on some of my folders.
For example:
#cd /storage/main_folder
#du -h --max-depth=2 subfolder1 | grep subfolder2
1.8G subfolder1/subfolder2/...
1
vote
1
answer
180
views
Can't find what is filling root
Ubuntu server 20.04.1 with Kubuntu Desktop.
I have tried lots of tools like Baobab, Kdirstat, Qdirstat and Filelight. All show my root to be about 30 GB. However Dolphin(File Manager) and all the ...
0
votes
0
answers
68
views
Discrepancy between df and du
I'm tracking down disk usage, and I am getting different results from df and du.
When I installed Ubuntu, I ticked the box to encrypt my home directory, so my df -h outputs the following mounts (among ...
2
votes
0
answers
4k
views
No space left on device, even though there is
similar questions on this site did not have a solution for me.
I'm developing a web app with symfony, and tried to start a local server, which resulted in a warning and didn't start anything
che6yp@...
0
votes
0
answers
360
views
du /home | sort -nr +0 -1 | head –10
I am a little confused with this command. Can someone please explain what the output of this command is? I see it in my terminal, but I do not understand what it is showing me.
0
votes
0
answers
37
views
Log folder having 236 GB Free space
I have lost 236 GB because the log folder is taking so much free storage. I used du and sudo du and the 236 GB are unused.
How can I fix this?
-3
votes
2
answers
1k
views
Terminal: du -sm [duplicate]
I have to complete some activity for my university and I need to know what does the command du -sm.I have already searched in many websites but i didnt find the answer.
Could you help me?
4
votes
1
answer
8k
views
Print size of directory content with tree command, but exclude files from report
I often use
du --max-depth=n -h | sort --human-numeric-sort
Now I want to use tree, in a similar manner.
I found here a partial answer
tree -sh --sort=size --du
where --du makes tree reporting the ...
7
votes
2
answers
1k
views
Prevent du command report inflated info about /snap directories
I have an Ubuntu 20.04 server installed on a single 8GB drive. The default installation has some "snap"s installed also. So, there are some "squashfs" file systems also reported by the df command:
# ...
1
vote
1
answer
94
views
Finding directories inside a folder and deleting folder + parent if subdirectory is smaller than a certain size?
I use gmusic to order and organise my folder structure. However this means I am left with some folders that do not have any files other then normally, a image cover.
I would like to sort through all ...
5
votes
1
answer
8k
views
What is difference between ls -lh and du -sh?
$ ls -lh file1.tar
-rw-r--r-- 1 wnice wnice 40K Aug 6 20:41 file1.tar
$ du -sh file1.tar
80K file1.tar
Why is it showing different sizes of same file? Please help me understand
1
vote
1
answer
97
views
Which folders are in /dev/sde3?
How to see which folders are in /dev/sde3 ?
df -h
/dev/sde3 39G 32G 4.8G 87% /
Doing:
cd /
sudo du -d 1 -h | sort -hr
Also shows me folders like:
/dev/sde4 ...
1
vote
2
answers
196
views
Deleting empty while keeping non empty 4KB files in Ubuntu
I have a folder that contains hundreds of thousands of small .txt files of size 4kb. Some of them are totally empty while others are not. However, they all show the same size 4kb since this is the ...
2
votes
1
answer
745
views
File size differs between ls and ncdu
I'm a little confused. With ls -laght a file with the size 1,0T is displayed:
-rw------- 1 nogroup 1,0T May 6 14:01 nextcloud-flat.vmdk
with ncdu only 9,1 GB:
/mnt/backup/backup/nextcloud/nextcloud-...
0
votes
2
answers
158
views
Big file on ubuntu 16.04 virtual machine
When I execute sudo du -h --max-depth=1 I get this result:
The 13g are taking the whole space of the virtual machine but when I execute ls -la the files size total size is only 96k.
I'm not sure ...
1
vote
1
answer
94
views
Unable to free diskspace by removing files and not restarting the computer (hibernation possible)
I have a similar problem to the one mentioned here: Unable to free up space in df but I can not reboot (I have important data in the memory).
The output of df -h / is:
Filesystem Size Used ...
0
votes
4
answers
5k
views
How to filter du output?
So that it won't show directories that contain an empty file named "0k" that I use as a flag ? It seems --exclude can't deal with that.
0
votes
2
answers
1k
views
How can I check all used space on filesystem in linux?
I've already tried du-ch , df -h and df -h --total but it all result to their specific size of folder. Need to know how can I get the total used space in human readable form. Hoping for your help. ...
1
vote
2
answers
107
views
Find the total space occupied by the ISO's on FS?
I want a awk script to find the sum $1 of the output of
sudo find / -type f -iname *.iso -print0 | xargs -0 du
Though it wouldn't be difficult to bring the output in human readable format but it ...
4
votes
2
answers
5k
views
du command - show file or folder in output?
If I run the command du -ah | sort -nr is it possible to make it show which line in the output is a file and which folder? Something like the command ls -l shows which is file and folder with d and - ...
0
votes
1
answer
256
views
How do I refresh GT5 every X amount of seconds?
I'm using the terminal GUI program GT5, which is a "du -browser". I want to have this program either automatically refresh every 30 seconds, or run every 30 seconds, quit, then repeat. What is the ...
0
votes
1
answer
4k
views
Simple way to count disk usage after a certain date
I am looking for a simple way to count the used space in a directory (and sub-dirs) from a certain date onward.
This could be done by creating an exclude file with find and parsing this to du with an ...
9
votes
1
answer
13k
views
Real size of folder?
When I run du -hs Folder in the terminal I get: 118M
When I run du -s Folder in the terminal I get: 120664M
When I run du -h Folder in the terminal I get: 118m
When I find the size through the file ...
3
votes
3
answers
2k
views
Bash Script - How can I get the size of directories in .txt file and save them into other file?
I started a few weeks with Linux bash programming, but I'm struggling with a problem: How can I get the size of multiple directories (path saved on a .txt file) and then, write into another file, the ...
12
votes
2
answers
12k
views
How to get a full size of directory without listing the files/dir within?
I am able to get a size of a directory at the end of the du -h directoryname. But is there a way to get the size without it listing the files/directories within?
I'm currently doing it like this:
du ...
1
vote
0
answers
480
views
keep same inodes metadata with rsync or ignore metadata with du
I'm trying to synchronize two folders from a remote computer.
I want to use rsync to send the folder, and du to check if the space used is identical on the remote computer.
The problem is even with a ...
2
votes
1
answer
2k
views
Intermittent - Error: No space left on device
Having intermittent issues when starting and stopping searches. I get a
Error: No space left on device
intermittently.
Have done some searches and most fixes are related to inodes, which you can ...
1
vote
1
answer
241
views
Can somebody explain this changing `du` output?
Just tripped across a weird case of du. Putting arguments one way gives:
$ du -s htdocs/.git/ feuerkraft/.git/ media/.git/
40564 htdocs/.git/
40740 feuerkraft/.git/
204 media/.git/
Putting them ...