If you have installed a lot of software on your system, package cache can take up a lot of disk space. These package managers download packages from internet and store them in a cache directory. Linux uses package managers to install and manage software. If trash is taking up too much disk space, you can empty it using following command − $ rm -rf ~/.local/share/Trash/* You can check size of trash directory using "du" command. Linux has a trash directory where deleted files are stored until you empty trash. If you have deleted files from your system, they might still be taking up disk space in trash. If these files are taking up too much disk space, you can either delete them or configure your system to rotate them. You can check size of these files using "ls" command. The most common log files are "syslog" and "auth.log" files. Linux has several log files that you can check to see if they are taking up too much disk space. Log files can also take up a lot of disk space, especially if you have not configured them properly. type f -size +100M -exec ls -lh " option tells command to execute "ls -lh" command on each file that matches search criteria. You can use "find" command to do that.įor example, if you want to find all files larger than 100MB in current directory and its subdirectories, you can run following command − $ find. Once you have identified directories that are taking up most of disk space, next step is to identify large files in those directories. The "-max-depth=1" option tells "du" command to only show disk usage of directories in current directory, and not their subdirectories. If you want to see disk usage of all directories in current directory, you can run following command − $ du -h -max-depth=1 If you want to see disk usage of a specific directory, you can replace "." in command with path of directory. The "-s" option shows total size of directory, while "-h" option makes output human-readable. most common tool is "du" command, which shows disk usage of a directory.įor example, if you want to see disk usage of current directory, you can run following command − $ du -sh Linux has several command-line tools that can help you do that. The first thing to do is to check disk usage of your system. In this article, we will cover following sub-headings to help you identify where your disk space has gone − Check Disk Usage It can be frustrating, but fortunately, there are several tools and techniques you can use to track down where disk space has gone on Linux. As a Linux user, you might have come across a situation where you ran out of disk space, but you are not sure where all space has gone.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |