首先你要确定是不是真正的是因为数据空间占满磁盘,经常是因为某个程序的日志占满了空间。当发现磁盘满了以后不要着急,使用以下命令从根目录开始排除查找哪个文件夹最大:
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. 【Scala】Scala学习资料

    Scala学习资料 java 树形 分类器_百度搜索 决策树分类器-Java实现 - CSDN博客 KNN分类器-Java实现 - CSDN博客 学习:java设计模式—分类 - 飞翔荷兰人 - 博客 ...

  2. 条件随机场(CRF)原理和实现

    版权声明:作者:金良山庄,欲联系请评论博客或私信,个人主页:http://www.jinliangxu.com/,CSDN博客: http://blog.csdn.net/u012176591   目 ...

  3. WebRTC学习之九:摄像头的捕捉和显示

    较新的WebRTC源代码中已经没有了与VoiceEngine结构相应的VidoeEngine了,取而代之的是MeidaEngine.MediaEngine包括了MediaEngineInterface ...

  4. firefox chrome ie9,10,11 不支持selectSingleNode和selectNodes的解决方法

    firefox并不支持selectSingleNode和selectNodes的解决方法 function test(){ var perid = document.thisForm.PerID.va ...

  5. 谷哥的小弟学前端(10)——JavaScript基础知识(1)

    探索Android软键盘的疑难杂症 深入探讨Android异步精髓Handler 具体解释Android主流框架不可或缺的基石 站在源代码的肩膀上全解Scroller工作机制 Android多分辨率适 ...

  6. 微信小程序 - 分包加载(分包使用)

    使用分包(建议主包添加跳转路径,分包放内容) 在app.json配置"subpackages" 在pages同级目录新建文件夹以及文件 打包原则 声明 subpackages 后, ...

  7. 1052: 旋转单词(words)

    #include <iostream> #include <iomanip> #include <cstdlib> #include <string> ...

  8. bash shell 获取当前正在执行脚本的绝对路径

    https://my.oschina.net/leejun2005/blog/150662 http://blog.csdn.net/10km/article/details/51906821 如题, ...

  9. Atlas系列一:【已解决】error while loading shared libraries: libcrypto.so.6: cannot open shared object file: No such file or directory

    1:Atlas的安装 https://github.com/Qihoo360/Atlas/wiki/Atlas的安装 2: [root@localhost bin]# ./mysql-proxyd t ...

  10. 阿里JAVA开发面试常问问题总结2

    线程与进程 进程是可并发运行的程序在某个数据集合上的一次计算活动.也是操作系统进行资源分配和调度的基本单位. 线程是操作系统进程中能够并发运行的实体,是处理器调度和分派的基本单位. 每一个进程内可包括 ...