Linux出现cannot create temp file for here-document: No space left on device的问题解决

在终端输入:cd /ho 按tab键时,显示错误:

bash: cannot create temp file for here-document: No space left on device

这是由于该磁盘的空间已经满了,这时候可以进行扩容,或者将该磁盘的部分目录迁移到别的磁盘。

以下为解决思路,查找最大的文件,然后将其干掉:

1、使用命令df -h 查看硬盘空间 

2、命令top查看cpu及内存

3、使用命令du -h –max-depth=1 /var/log/* 查看/var/log路径下文件的大小

4、du -sh /* 查看哪个目录最大,一步一步的查找大文件

5、使用du -h --max-depth=1查找最大的文件,参考:http://www.cnblogs.com/kerrycode/p/4391859.html

转自:http://www.cnblogs.com/EasonJim/p/6833354.html

原文地址:https://www.cnblogs.com/lazyfang/p/7615452.html