On Sun, 2019-10-20 at 00:06 +0000, George R Goffe via users wrote:
Hi,
Just my 2 cents.
first: I'm sure you remember that even if you find a huge file and remove it, the
space it occupies will not be available IF the file is still open. I had a /var file
system full some time ago and it was /var/log/messages that was HUGE. Removing it
didn't help until I recycled syslogd.
second: Here's a function in my .bashrc that I use recursively on a filesystem
that's getting close to being full. It's VERY helpful to me and I don't have
to type a lot. :-)
dus ()
{
echo $sorttmp $sortmem;
case $# in
0)
/usr/bin/du -xs -- .??* * 2> /dev/null | sort -k1nr | more
;;
*)
/usr/bin/du -xs -- $* 2> /dev/null | sort -k1nr | more
;;
esac
}
Why the "echo" of two unset variables at the start?
What is the '--' argument to 'du' doing? (it's not defined in the
'du'
manual, though I assume it has the usual meaning of making leading '-'s
in following arguments non-special.)
What is special about '.??*' ? Is this just to skip '.' and '..'?
What do the '-k1' arguments to 'sort' do? The 'sort' man page
defines
'-k' as introducing a field argument, but the output of 'du' has the
size in the first field anyway.
Just curious.
poc