


# apt autoremoveįor other distributions using dnf, the below command can be used. With Debian and Ubuntu distributions, the APT’s version of the autoremove command can be used. The autoremove option can be used to clean up unwanted packages as described below depending on the OS distribution installed in the server.įor CentOS, AlmaLinux and Rocky Linux distros, the autoremove option can be used along with yum command. The autoremove option is used to clean up the unwanted packages and their dependencies along with it. Most package managers come with an autoremove option that can be used to remove any unwanted packages on the server. Some of the common actions that can be performed in order to free-up disk space in a Linux system are mentioned below: Once the disk space in the server is noticed to be running low, it is a requirement that enough disk space is freed up in the server for the services to be running without interruption. # du -sch /bootĬleaning/clearing disk space on Linux system

The total disk space usage in human-readable format can be displayed by using the -h switch in the above command. # du -s /bootīy using the -c switch along with the above command, the grand total disk usage value of the folder can be displayed. Using the -s switch summarizes and shows the total disk usage by the argument value passed along with the du command. Using the du command alone will show the disk space usage of the folder as well as the files under it. The example folder being considered in this context is /boot. The below set of example commands shows the different uses of the above-specified switches when used along with the du command. To get the overall directory utilization, the -s and -c switches are used, in which the -c switch is used to get subtotal of the items. The -h switch can be used to display values in human-readable units such as KB, MB, GB and TB. The file/folder size is usually displayed in KB while using the du command. For this purpose, different switches can be used to retrieve the appropriate output. In a Linux system, the du command is used to determine how much disk space is being utilized by files and folders. The df command can also be used to target a specific drive, using either its Filesystem or Mounted on description from the disk space results being displayed. The below command can be executed to list the disk space with file system types. The -h option can be used along with df command to show the results in a human-readable format. This option shows the amount of disk space available in kilobytes (K), megabytes (M), and gigabytes (G).Įxecuting the df command alone will list the disk space usage without any formatting. You can use the -h option to make the output easier to read.

The df command can be used to view the available disk space for each drive on the Linux system.īy default, the df output shows the usage in KB. There are two commands available for finding available and used disk space in a Linux server, which are namely the df and du commands.
#Cmd clean disk command free
This guide outlines the basic steps that can be performed to check the disk space status in a Linux server and also the actions that can be carried out to free up disk space in the Linux system. Clearing disk space in a Linux system to free up storage space is a certainty that will arise at some point. Another cause could be that the system's disk space is severely low, as indicated by any relevant warning.
#Cmd clean disk command install
On a Linux system, freeing up disk space may be required if there arises a need to install more software.
