![finding df root folder finding df root folder](https://i.stack.imgur.com/Kwjca.png)
This entry was posted in Linux and tagged File system, Linux on Januby ss.Find and replace in file Quick summary: I am going through all ("*.
FINDING DF ROOT FOLDER FREE
I think this is a nice little trick and it has saved me a lot of time and trouble in the past, if you like it, feel free to leave a comment below and rate the post at the top! You can now do the same like the above, but on /home/ss/ instead. Here you see that “/home/ss” is the folder taking up almost all the space used by /home.
![finding df root folder finding df root folder](https://www.ibm.com/support/pages/system/files/support/swg/sectech.nsf/0/36fe2683b6e880eb85258006007ad141/Content/0.9DF0.gif)
This time you see the folder indside /home. home is the seconds largest folder, so let’s take a look into it by putting the directory path into the command we just used (this time without the /run and /proc excludes, since these are not located in the /home folder): du /home -h -d 1 by me /mnt is the biggest, this is because I got a secondary hard disk for storage. Here you see that a couple of folder contains a lot of data. The output will look similar to this (it might take a little time to execute): This would show you the total size of all folder in the root ( / ) folder except for /proc and /run since these are for process info and early boot stuff so they are not important and will likely gives you read error if you try to read them since files are created and deleted almost instantly there. You could start out by running the following: du / -h -d 1 -exclude=/proc -exclude=/run
![finding df root folder finding df root folder](https://www.tecmint.com/wp-content/uploads/2013/09/Linux-Directory-Structure.jpeg)
This is where this command “du” becomes handy. Let’s say your Linux server has run out of disk space, or almost, and you dont know what suddenly is using it all. Again I put in “-h” to make it readable: du -d 1 -h If you only want the total of the current directory, and one level down subdirectory’s but don’t want to see everything below that you could use the “-d 1” option. Again I use “-h” to make it readable: du -exclude=*.mp3 -h These files will not be includes in the final count. You could use “–exclude=*.mp3” like you see below to ignore all files ending with “.mp3”. but you only want to know how much space the video’s a taking up.
FINDING DF ROOT FOLDER FULL
Lets say you have a folder full of mp3 music, and video’s. If you want to the total size of the current folder, and the total size of all subfolder displayed, you could use “-S” (capital S), again put on the “-h” to make it readable: du -S -h To just get the total size of the current folder, you could also use “-s” (small s), again put on -h to make it readable: du -s -h Put “-h” on there too, else you will get it in bytes. To get a total, of the directory, all subdirectories and files, put a “-c” on the command and the last line will be the total size. Note that “du” always counts all files and directories in the final size in the last line, but with the “-a” it displays the filenames along with the directory names in the output. This command will not only display the directories but also all the files that are present in the current directory. I recommend always appending -H, it just makes everything a lot more easy to read: du -h If you just run the command by typing the following, you get a list of all you folder and subfolders for the current folder: duĪgain a little tip on how I remember “du” is by saying what I want, which is viewing the “ Directory Usage” – Get it? ?Īppending a “-H” to the “du” command gives you are nice output in Bytes, Megabytes and Gigabytes just like with “df”. “du” is a bit more complex, but not much. This one I usually remember by telling myself that i’m a human, not a machine that easily can calculate the Byte value when running df without the -h option: “ Disk Free -h uman du There are some nice options you can set, to make the output a little bit more clear.Įxample, here is makes the sizes more readable by calculating them into Bytes, Megabytes, Gigabytes and so on. Just a little tip, I remember it by thinking that it’s short for something, and always come to the phrase “ Disk Free”
FINDING DF ROOT FOLDER HOW TO
Every Linux user is going to use these at one point in their life, and it is usually for when the shit has hit the fan and your server is out of diskspace and you have to find the source of the problem.įirst I will show you how to view free disk space. This post will explain two commands every linux user need to know.