Linux - cannot create temp file for here-document

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

早上,照常打开服务器连接,cd到目录的时候,习惯性的Tab去自动补全目录名,发现会有这个提示:cannot create temp file for here-document: No space left on device 上网一查,发现是服务器的磁盘满了,用df -h来看,发现used已经100%,那使用什么命令发现最大的文件是什么呢?


    方法一:


                linux查看根目录下所有文件夹大小的方法如下:

                1、进入根目录:cd /

                2、使用命令 :du -sh * 查看根目录下每个文件夹的大小搜索

                3、进入占用空间比较大的文件夹,然后再使用2中命令查找大文件。


    方法二:

                查找大于10M的文件


                find / -type f -size +10000000c -exec du -sh {} \;


                10000000 -> 就是10M的意思;


                1000 000000 ->就是1G的意思;


    顺便提一下清空多余log日志或者文件的命令:


                 cat /dev/null > xxx.log

posted @ 2022-01-27 18:36  zhangdaopin  阅读(397)  评论(0编辑  收藏  举报