We also found deleted files that were still locked by some process:
$ sudo lsof | grep deleted]]>
@Ravi Sorry for replying here; the “reply link” is missing from your latest comment.
> “but the command giving an error, see below”
sorry again, remove the "*"
from "xargs du -s *"
.
The fixed command is :
$ find $HOME -mindepth 1 -maxdepth 1 -type d | xargs du -s | sort -rn | awk '{system("ls -ld " $2) ; exit}'
@Gilles,
Thanks again, but the command giving an error, see below.
$ find . -mindepth 1 -maxdepth 1 -type d | xargs du -s * | sort -rn | awk '{system("ls -ld " $2) ; exit}' du: cannot access './VirtualBox': No such file or directory du: cannot access 'VMs': No such file or directory drwxr-xr-x 17 tecmint tecmint 184320 Nov 16 14:52 Downloads
Could you run the above command in your Linux setup, and share the output?
]]>Sorry for the two mistakes.
First, if running as root, wildcard ("*")
expansion includes “dot directories“, and current dir (".")
would always be the biggest one since it includes all others.
And there was also a mistake in the awk statement.
So this should do the trick:
$ find . -mindepth 1 -maxdepth 1 -type d | xargs du -s * | sort -rn | awk ‘{system(“ls -ld ” $2) ; exit}’
]]>@Gilles,
Thanks for the tip, but it didn’t work on my end. Here is the output of the command…
$ du -s * | sort -rn | awk '{system("ls -ld $2") ; exit}' drwxr-xr-x 33 tecmint tecmint 4096 Nov 16 10:46 .]]>