Linux Disk Space: Learning Linux to Solve Disk Space Issues
Learning Linux Commands to Solve Issues
The Jungle Disk support team helps customers solve a wide range of problems, from updating credit cards to troubleshooting network connectivity issues. There are times that we get users that are managing a Linux environment, but they admittedly aren’t too familiar with the operating system. This is not uncommon as many small businesses may not have a full-time administrator or someone on hand when troubleshooting is needed. This article will go over a couple of basic commands that may not only help in the troubleshooting process, but can serve as a stepping stone into becoming more familiar with the Linux operating system.
Disk Space Issues
Sometimes, your machine will run into disk space issues. With a Windows or Mac machine, there is a graphical user interface (GUI) that users can use to see how much space is available. However, since many Linux servers don’t have a GUI and use a terminal only (think white text on black screen), how can you tell how much free space is available? In the terminal, you can use the
df -h command. This will show the amount of space available in all the filesystems on the machine. The
-h option will output the information in a “human readable” format, such as in MB or GB for example. Most commonly, we have to use this command when Jungle Disk throws an error that there is not enough space for the local cache directory to do the download and verify the backup database, which uses local space dynamically as needed. This is a quick way to see how much free space you have overall.
Determining Folder Sizes
However, what if you use
df -h and determine you need to free up disk space? How would you see how much data is stored in specific folders, which you suspect of hogging up space? Here, you can use the
du -sh command. Running the command alone will show the total size of the directory and all folders and files underneath it. If you’re unsure of where you are in the filesystem, running
pwd will tell you. You don’t need to change directories to see the size of other folders though; all you need to do is add on the folder you want to look at on the end:
df -h [directory]. For example, if you want the size of the
/home/thomas directory, simply enter
df -h /home/thomas. You’ll notice this command has the
-h option as well; here, too, this outputs the size in a “human readable” format.
These are just a couple of helpful commands that will help you manage disk space on your system. These commands can do much more; if you want to take a peek at even more options, just use the
man command to see more, such as
man df. Use the
spacebar to scroll and the letter
q to exit the
My next support blog will cover a few more commands that will help in managing the system. Stay tuned and contact the support team if you have questions in the meantime!