How do I see exactly what’s taking all my space?
You can check disk usage using the du
command.
e.g.: du -h --max-depth=1 /home/abc123
Some things to consider:
- use the
--max-depth=N
option to limit results to a maximum of N nested levels. A level of 0 will show only the target/current dir. If you don’t limit the depth,du
will (kinda slowly) recursively total-up usage for every single file and nested folder. - use the
-h
flag to list K/M/G suffixes for kilo-/mega-/giga-byte sizes. If you don’t use this “human-readable” flag, raw number-of-blocks will be displayed instead.
Here’s an example of output you might see in your ~ dir:
[abc123@wind ~ ]$ du -h --max-depth=2 ~
1.6G /home/abc123/.conda/envs
2.3G /home/abc123/.conda/pkgs
3.9G /home/abc123/.conda # roughly equal to (envs + pkgs)
16K /home/abc123/.rstudio/monitored
4.0K /home/abc123/.rstudio/notebooks
4.0K /home/abc123/.rstudio/projects
5.4G /home/abc123/.rstudio/sessions # ~100% of rstudio data is here
288K /home/abc123/.rstudio/sources
20K /home/abc123/.rstudio/pcs
5.4G /home/abc123/.rstudio # roughly the same size as 'sessions'
785M /home/abc123/R/3.6.3
785M /home/abc123/R
9.9G /home/abc123
In this case, you could say that most of abc123’s (9.9 GB) /home usage is being filled by the “hidden” configuration/data folders for Anaconda and RStudio.
Further, one could observe that only the .rstudio/sessions/ directory accounts for ~100% of the usage within its parent .rstudio/ directory. (See below, if this applies to you.)
If you can’t see files/directories that start with dots
Use the “-a” flag (i.e. ls -a
) if you want ls
to show things starting with a dot.
(Please see this_other post about how to interact with hidden files on Linux systems.)
If you need to reduce your .conda directory
Please see this entry, in Monsoon’s FAQ:
If you need to reduce your .rstudio directory
Please see these articles from RStudio: