Greetings everyone.
I have seen that you do wonders here.
I have a large folder on a Ubuntu linux.
Organization main folder, inside 20 000 subfolders, and inside those subolders many other like 5-6 folders and files.
I am interested to create an output to a txt file under the bash shell, for the size only of those 20 000 subfolders, --maxdepth 1.
This is what I have tried so far, I was also trying to ommit with grep folders starting with a letter x, for testing. But whatever I do the command line hangs and produces no output.
du -h --max-depth=1 | sort -n
du /var -h --max-depth=1 | grep "^x.*" | sort -n
this produces nothing but this
ls -l | grep "^x.*"
gives some output on other server
du -h --max-depth=1 | grep x | sort -n | cut -f2 | xargs -d '\n' du -sh
Any help would be appreciated.
Thanks in advance.