top of page
Search

How can I find out how much space my home directory is occupying?

  • Writer: Mohd Athar
    Mohd Athar
  • Jul 22, 2021
  • 2 min read

You can only do this on a Linux system. If you have an undergrad or instructional account, use ssh to log into "attu". If you are a graduate student, or have a research account, log into "bicycle".

Let's assume you are an undergrad student and your CSENetID is "jouser." If not, you can make the appropriate adjustments to the directory/folder names given below.

To check the amount of space (in GB) taken up by your home directory, run the following commands: cd ~; du -hs

To display the aggregate size of each file or subdirectory (including hidden files and subdirectories) contained within the current directory, sorted by size (largest first), run the following command: du -sk * .??* | sort -nr

Use "m" instead of "k" in the "du" command if you want the size reported in megabytes, e.g. "du -sm ...".

To display a sorted list showing the size of each file (only files) in the current directory and (recursively) in all subdirectories, run the following command: find . -type f -printf "%k %p\n" | sort -nr | less

Note: if the find command complains about not having a "printf" option, use the following to display an "ls" list, sorted by size, of all files in the current directory and (recursively) in all subdirectories: find . -type f -ls | sort -nr -k 7,7 | less

To find the Linux host on which your home directory resides, run "df ~". If the "Filesystem" displayed begins with "/", your home directory resides on the host you are currently logged in on; if it begins with "<host>:/", your home directory is on <host>.

 
 
 

Recent Posts

See All
rsync at remote server

without password: ssh-keygen [WITHOUT entering any passphrase] ssh-copy-id user@remote-host (example: ssh-copy-id altair) nohup rsync...

 
 
 

Comments


bottom of page