total size of all files in a folder linux code example Example 1: how to get the size of directory in linux du -sh /var Example 2: check folder size in linux terminal du -sh /home/user/