On 12/3/18 11:29 am, Robert Nichols wrote:
On 03/11/2018 07:19 PM, Stephen Morris wrote:
On 12/3/18 10:48 am, Philip Rhoades wrote:
JD, Gordon, Robert,
On 2018-03-12 06:13, Robert Nichols wrote:
On 03/11/2018 01:48 PM, Philip Rhoades wrote:
People,
I started deleting GBs of stuff from:
/dev/sdb1 /backup
but df did not reduce from 95% so I looked more closely and found this weirdness:
# du -s -BG 20180216 43G 20180216
# du -s -BG 20180216/* 1G 20180216/naf_dirs 43G 20180216/phil 1G 20180216/root
# du -s -BG 20180216/phil/* 1G 20180216/phil/0 1G 20180216/phil/0_finance 1G 20180216/phil/0_naf 1G 20180216/phil/Maildir 1G 20180216/phil/txts 1G 20180216/phil/vimwiki
Where has ~37GB disappeared to? There are no files held open and I have successfully umounted and re-mounted the partition - what is going on?
That "du -s -BG 20180216/phil/*" is ignoring any "dot" files/directories under 20180216/phil .
It's better to leave out the "-s" option and use the "--max-depth" option to limit the depth of the display. du -BG --max-depth=1 20180216/phil
Damn, I should have thought of that - normally, outside of .config, there would not be much in my dot dirs - but I had been experimenting with cryptocurrency nodes . .
Thanks for the useful tips!
Regards,
P.
Just one question on this, is the scaling that the -BG screwing around with the results of du as shown below?
bash-4.4$ du -s -BG /home/steve 8G /home/steve
bash-4.4$ du -s -BG /home/steve/* 1G /home/steve/andrew 1G /home/steve/config 1G /home/steve/Desktop 1G /home/steve/Documents 1G /home/steve/Downloads 1G /home/steve/gtk.css 1G /home/steve/jxbrowser-browser.log 1G /home/steve/jxbrowser-chromium.log 1G /home/steve/jxbrowser-ipc.log 1G /home/steve/jxbrowser-ipc.log.1 0G /home/steve/jxbrowser-ipc.log.1.lck 0G /home/steve/jxbrowser-ipc.log.lck 1G /home/steve/l10n 1G /home/steve/Music 1G /home/steve/NetBeansProjects 1G /home/steve/Pictures 1G /home/steve/Public 1G /home/steve/R 3G /home/steve/rpmbuild 1G /home/steve/Templates 1G /home/steve/Videos 1G /home/steve/workspace
du -s -BG /home/steve/workspace/* 1G /home/steve/workspace/basics.zip_expanded 1G /home/steve/workspace/jsf-blank.zip_expanded 1G /home/steve/workspace/jsffacletstutorial 1G /home/steve/workspace/libraries 1G /home/steve/workspace/RemoteSystemsTempFiles 1G /home/steve/workspace/Servers 1G /home/steve/workspace/test-app 1G /home/steve/workspace/whirlwind
Of course it is. Any size greater than 0 and not exceeding 1GB will show as 1G. It's answering the question, "How many blocks 1GB in size would it take to hold this?" Anything of non-zero size will take at least 1 such block.
So, your "workspace" directory contains 8 things, none of which is larger than 1G, and the total space for all of them is also less than 1G.
Thanks Robert, so basically what you are saying is that if you use that parameter, the output is rounded up to the nearest integer representation (in this case Gig) rather than displaying it as a fraction? For example, for a file that is 600 MB in size I would have expected the command to display it as 0.6G rather than 1G.
regards,
Steve