This is the size of a directory
casper@casperbox$ du -sh /home/casper/
28G /home/casper
I have a script that checks the size of the directory.
#!/bin/bash
SIZEOFdir="/home/casper/"
humanReadSizeonly=$(du -sh $SIZEOFdir | awk '{print $1}')
Instead of using awk in this context, as I always do, what is the pure bash non awk way of getting just the 28G ? And I don't want to use cut. There is some bash function in bash, and I really don't know what its name is.
I use this to get rid of .sh or .pl from filenames.
${var%.*}
I just do not know what the method is called.