trope wrote: ⤴Sun Nov 18, 2018 2:17 pm
Yes, quite right, these last commands are very close to me finding out where the space is being used. Is there a shortcut command so I do not have to right click on every folder to check its size, in multiple top-level folders? Eg, I would like to know the largest files and subdirectories under "/".
Don't bother with a file-browser, it's too slow.
This will show you all the files in your OS, sorted by size:
...and the containing directories will be at the end.
This will show you all the directories in your OS, sorted by size:
This one will show the top-level directories using the most space:
-a = show all files, not just directories.
-d 1 = go down one directory level
-x = stay on the file system (= the same partition...don't look in partitions mounted to, say, /mnt or /media). Of course that can cause you problems if /home or /boot are a separate partitions.
You can also
Code: Select all
sudo du /var | sort -n
sudo du /boot | sort -n
to just look at /var or /boot.
I did not understand your second to last post, but would be interested, eg, what does it mean that " the highest level of **everything** (/home=user data, and /mnt or /media="data data") is parallel to the OS, e.g. /usr, /lib, /etc etc". My understanding is that there are 2 ways to look at everything, where the data is actually stored, and where it is mounted?
Where it's mounted is what counts because that's how you access the files; say your OS is on /dev/sda1, and your data (movies and music, etc) is on /dev/sda2: the two partitions are "parallel" to each other (one does not contain the other), but when you mount sda2 to, say,
/mnt/data
, now it *is* "under" "/", along with /usr and the rest of the OS, and simple operations (like "find" or "du") will look in /usr and /mnt...because they're both under "/".
Edit:
Your "/" is /dev/sdb2, mounted to "/"
your data is /dev/dm-0, mounted to "/media/me/data"
In windows, I think, this isn't an issue: an added D: partition (e.g. an ntfs-formatted sda2 parition for data) isn't mounted under "C:", like "C:\D:", so when you look for files in C: it doesn't include D:, and vice-versa (though their actual searching might be weird...probably). Windows has some point ("My Computer") that is "above" both C: and D:.
But in linux the equivalent of D:, say sda2 with data and no OS, gets mounted to some mount-point that's under "/"...because everything is under "/". "/" = "My Computer"