Home >Operation and Maintenance >Linux Operation and Maintenance >Solution to insufficient disk space in linux

Solution to insufficient disk space in linux

王林
王林Original
2019-12-25 17:19:023773browse

Solution to insufficient disk space in linux

1. First, determine whether there is insufficient disk space.

Enter the following command to view the disk information:

df –h

Solution to insufficient disk space in linux

## Obviously: the 40G capacity under the mount point /dev/xvda1 under Filesystem has been exhausted.

The easiest way at this time is to find large and useless files and delete them. The first choice is the log file.

Recommended related video tutorials:

linux video tutorial

2. Enter the following command to find the current directory and which folder takes up the most space

du -h --max-depth=1

Solution to insufficient disk space in linux

3. Enter the logs folder

Enter the following command to display the files in order from large to small

ls –lhS

Solution to insufficient disk space in linux

Enter the following command Complete cleanup.

> ./catalina.out

Solution to insufficient disk space in linux

Note: If the process is in use when clearing the log, an error will be reported when using rm -f to delete, or the disk will still be full even if it is deleted, so Using the command to clear the contents of the log file is better than deleting this file.

Recommended related articles and tutorials:

linux tutorial

The above is the detailed content of Solution to insufficient disk space in linux. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn