首先你要确定是不是真正的是因为数据空间占满磁盘,经常是因为某个程序的日志占满了空间。当发现磁盘满了以后不要着急,使用以下命令从根目录开始排除查找哪个文件夹最大:
du --max-depth=1
找到最大的目录后,进入目录再执行上面的命令,逐步就找到大空间的文件夹了,如果是日志文件删除了就可以了。
下面是du命令的详细用法:

用法:du [选项]... [文件]...
或:du [选项]... --files0-from=F
总结每个<文件>的磁盘用量,目录则取总用量。

长选项必须用的参数在使用短选项时也是必须的。
-a, --all write counts for all files, not just directories
--apparent-size print apparent sizes, rather than disk usage; although
the apparent size is usually smaller, it may be
larger due to holes in (`sparse') files, internal
fragmentation, indirect blocks, and the like
-B, --block-size=SIZE use SIZE-byte blocks
-b, --bytes equivalent to `--apparent-size --block-size=1'
-c, --total produce a grand total
-D, --dereference-args dereference FILEs that are symbolic links
--files0-from=F summarize disk usage of the NUL-terminated file
names specified in file F
-H like --si, but also evokes a warning; will soon
change to be equivalent to --dereference-args (-D)
-h, --human-readable print sizes in human readable format (e.g., 1K 234M 2G)
--si like -h, but use powers of 1000 not 1024
-k like --block-size=1K
-l, --count-links count sizes many times if hard linked
-m like --block-size=1M
-L, --dereference dereference all symbolic links
-P, --no-dereference don't follow any symbolic links (this is the default)
-0, --null end each output line with 0 byte rather than newline
-S, --separate-dirs do not include size of subdirectories
-s, --summarize display only a total for each argument
-x, --one-file-system skip directories on different file systems
-X FILE, --exclude-from=FILE Exclude files that match any pattern in FILE.
--exclude=PATTERN Exclude files that match PATTERN.
--max-depth=N print the total for a directory (or file, with --all)
only if it is N or fewer levels below the command
line argument; --max-depth=0 is the same as
--summarize
--time show time of the last modification of any file in the
directory, or any of its subdirectories
--time=WORD show time as WORD instead of modification time:
atime, access, use, ctime or status
--time-style=STYLE show times using style STYLE:
full-iso, long-iso, iso, +FORMAT
FORMAT is interpreted like `date'
--help 显示此帮助信息并退出
--version 输出版本信息并退出

[大小]可以是以下的单位(单位前可加上整数):
kB 1000,K 1024,MB 1000000,M 1048576,还有 G、T、P、E、Z、Y。

du命令解决linux磁盘空间满的问题(很不错的哦)的更多相关文章

  1. linux磁盘空间满的处理

    Java中运行SQL插入数据时报错: linux磁盘空间满处理: 1.df -h  查看磁盘空间占用,实际上是查看磁盘块占用的文件(block) 2.分别查看输入以下命令 (面对磁盘满了,通过下列命令 ...

  2. linux磁盘空间满?

    磁盘空间满啦 找到项目的logs文件夹 进入logs文件夹,会看到很多access.log*文件. 在Xshell里,输入命令cd 到项目节点的logs文件夹 可能还需要清空下回收站.

  3. 云服务器 ECS Linux 磁盘空间满(含 innode 满)问题排查方法

    问题描述 在云服务器 ECS Linux 系统内创建文件时,出现类似如下空间不足提示: No space left on device … 问题原因 导致该问题的可能原因包括: 磁盘分区空间使用率达到 ...

  4. Linux磁盘空间满的诡异问题解决方案

    问题描述: 今天登上一台服务器,df -h 发面根目录磁盘已经满了 解决过程: cd / du -sh *  发现并没有大文件,占用的空间没多大 根据经验,先通过lsof | grep deleted ...

  5. Linux学习之CentOS(十七)-----释放 Linux 系统预留的硬盘空间 与Linux磁盘空间被未知资源耗尽 (转)

    释放 Linux 系统预留的硬盘空间  大多数文件系统都会保留一部分空间留作紧急情况时用(比如硬盘空间满了),这样能保证有些关键应用(比如数据库)在硬盘满的时候有点余地,不致于马上就 crash,给监 ...

  6. Linux磁盘空间查看、磁盘被未知资源耗尽

    Linux系统中,当我们使用rm在Linux上删除了大文件,但是如果有进程打开了这个大文件,却没有关闭这个文件的句柄, 那么Linux内核还是不会释放这个文件的磁盘空间,最后造成磁盘空间占用100%, ...

  7. Linux磁盘空间被未知资源耗尽【转】

    Linux磁盘空间被未知资源耗尽 在linux中,当我们使用rm在linux上删除了大文件,但是如果有进程打开了这个大文件,却没有关闭这个文件的句柄,那么linux内核还是不会释放这个文件的磁盘空间, ...

  8. Linux磁盘空间被未知资源耗尽

      在linux中,当我们使用rm在linux上删除了大文件,但是如果有进程打开了这个大文件,却没有关闭这个文件的句柄,那么linux内核还是不会释放这个文件的磁盘空间,最后造成磁盘空间占用100%, ...

  9. No space left on device 解决Linux系统磁盘空间满的办法

    最近Linux电脑在执行mvn时候总是报错: No space left on device   原因是磁盘空间满了,我马上加了20G的硬盘容量,但是还是报错,上网查了一下,发现了解决方法,我用了其中 ...

随机推荐

  1. 【Spark】Spark Streaming 动态更新filter关注的内容

    Spark Streaming 动态更新filter关注的内容 spark streaming new thread on driver_百度搜索 (1 封私信)Spark Streaming 动态更 ...

  2. BiLSTM-CRF模型中CRF层的解读

    转自: https://createmomo.github.io/ BiLSTM-CRF模型中CRF层的解读: 文章链接: 标题:CRF Layer on the Top of BiLSTM - 1  ...

  3. thinkphp5在URL地址里隐藏模块名

    新的Thinkphp5的路由功能很强大,完全可以自定义以满足自己的要求   ThinkPHP5.0的路由规则如下:http://serverName/index.php/module/controll ...

  4. java多线程之间的顺序问题

    java 多线程: 这样写有问题的:这样写可以的: package com.test; import java.util.concurrent.CountDownLatch; import java. ...

  5. OpenNebula学习第四节之磁盘镜像的制作

    一.准备工作 需要准备一个Ubuntu16.04的ISO文件上传至服务器,如下图所示 二.操作步骤 2.1:创建操作目录 创建一个/var/tmp/cloud_image目录,把Ubuntu16.04 ...

  6. 【math】梯度下降法(梯度下降法,牛顿法,高斯牛顿法,Levenberg-Marquardt算法)

    原文:http://blog.csdn.net/dsbatigol/article/details/12448627 何为梯度? 一般解释: f(x)在x0的梯度:就是f(x)变化最快的方向 举个例子 ...

  7. 《OpenGL® ES™ 3.0 Programming Guide》读书笔记1 ----总览

    OpenGL ES 3.0 Graphics Pipeline OpenGL ES 3.0 Vertex Shader Transform feedback: Additionally, OpenGL ...

  8. 阿里云centos安装ftp与svn过程

    1.下载xshell或者secureCRT 2.登录centos或者服务器 3.安装vsftpd [root@xxx]# yum install vsftpd //安装vsftpd [root@xxx ...

  9. OpenGL ES 3.0之VertexAttributes,Vertex Arrays,and Buffer Objects(九)

    顶点数据,也称为顶点属性,指每一个顶点数据.指能被用来描述每个顶点的数据,或能被所有顶点使用的常量值.例如你想绘制一个具有颜色的立方体三角形.你指定一个恒定的值用于三角形的所有三个顶点颜色.但三角形的 ...

  10. Linux FastDFS 分布式文件系统安装

    Linux FastDFS 分布式文件系统安装 2013 年 3 月 11 日 – 09:21 | 930 views | 收藏  (No Ratings Yet) FastDFS是一款类Google ...