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

    http://blog.csdn.net/u014595019/article/details/52805444 tensorflow笔记系列: (一) tensorflow笔记:流程,概念和简单代码 ...

  2. 用keras实现lstm 利用Keras下的LSTM进行情感分析

    1    I either LOVE Brokeback Mountain or think it’s great that homosexuality is becoming more accept ...

  3. Fixing the JavaScript typeof operator

    https://javascriptweblog.wordpress.com/2011/08/08/fixing-the-javascript-typeof-operator/javascript 类 ...

  4. Eclipse关掉项目SVN的链接

    有时候 svn 会导致 eclipse 反应很慢,可以关掉 svn项目信息展现. 1. 点击项目文件夹,右键出现项目信息 2. 选择team项 3. Disconnect.

  5. vSCode打开文件老覆盖原窗口

    https://segmentfault.com/q/1010000006131199?_ea=1023522 设置中搜preview,改为false

  6. Android自己定义View之仪表盘

    新建项目,新建DashBoardView继承自View实现OnGlobalLayoutListener接口,并重写OnDraw方法. 使用OnGlobalLayoutListener接口须要重写onG ...

  7. android中使用spinner组件,以key,value的方式

    接着上一篇文章的内容:android中使用spinner组件 稍做修改,以key,value的方式,在实际使用中,经常需要获取的值并不一定跟显示的内容一致. 需要先添加一个对象类,用来描述key,va ...

  8. iOS开发 - Content hugging priority & Content compression resistance priority

    1. 什么是Content hugging priority 你可以把它想象成一根放在视图上的橡皮筋. 这根橡皮筋会组织视图超过它本身的固有大小(intrinsic content size). 它存 ...

  9. 解决IE兼容模式的方案

    在html头 加标签 强制使用最新的ie渲染 <meta http-equiv="X-UA-Compatible" content="IE=edge"&g ...

  10. 牛客网-《剑指offer》-变态跳台阶

    C++ class Solution { public: int jumpFloorII(int n) { <<--n; } }; 推导: 关于本题,前提是n个台阶会有一次n阶的跳法.分析 ...