I need to use "cd" on a shell script: move to the directory $home/folder/sub-folder and then check with a conditional statement if the directory's size is more than 2 MB.
How could I accomplish this? Thanks in advance.
As a suggestion, you should definitively take a look at man du
. Something like that might be a good starting point:
du -s $home/folder/sub-folder