What is SSH?
SSH means Secure Shell. SSH provides authentication by using the private key. It is the root access to your account from the remote system in a secured manner. SSH access is enabled for VPS and dedicated server.
How to get the size of all Folders in your Current Directory using SSH?
Disk Usage (du) command is a standard Unix/Linux command. It is used to check the information of disk usage of files and directories in the system. This command also displays the files and directory sizes. Using SSH, log in to the server as a root user and run the following commands.
# du – Displays the number of disk blocks in the home directory along with the subdirectories.
# du-h – Displays the size of all folders in the directory in human readable format.That means the size of folders can be seen in Bytes, Kilobytes, Megabytes and Gigabytes.
# du- sh – Displays the grand total disk usage size of a directory.
# du-a – Displays the disk usage of all files and directories.
# du-ah – Displays the disk usage of all files and folders in human readable format(Kb, Mb)
# du-k – Displays the disk usage of a directory tree with its subtrees in Kilobyte blocks(size in 1024 bytes units).
# du-mh – Displays the disk usage of a directory tree along with its subtrees in Megabytes(Mb).Here, “-m” flag counts the blocks in Mb units and “-h” stands for the human readable format.
# du-ch – Displays the grand total disk usage space at the last line.
#du-ah--exclude="*.txt" – Displays the disk usage of files and directories but excludes the file that matches the given pattern. This command excludes the “.txt” files while calculating the total size of the directory.
# du-ha--time – Displays the disk usage based on the modification of time by using the flag “-time”.