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

The first time I used Ubantu, I encountered this annoying error (-bash: cannot create temp file for here-document: No space left on device). Since I am familiar with centos, I can basically understand the error. This error is Say our /tmp space is full, you can use the df -h command to view

root@xxxxxx:~# df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            2.0G   12K  2.0G   1% /dev
tmpfs           396M  832K  395M   1% /run
/dev/vda1        20G   15G  4.5G  76% /
none            4.0K     0  4.0K   0% /sys/fs/cgroup
none            5.0M     0  5.0M   0% /run/lock
none            2.0G  4.0K  2.0G   1% /run/shm
none            100M     0  100M   0% /run/user
/dev/vdb1        99G   30G   65G  32% /big
overflow        1.0M  1.0M     0 100% /tmp

Since this directory is full, we can either delete some of the useless ones, and that's it. big

Of course, we can also create the tmp directory ourselves, so that this full directory can be replaced,

root@xxxxxx:~# mkdir /big/tmp -p 

root@xxxxxx:~# export TMPDIR=/big/tmp

Next, when we execute the command again, we will find that we are refreshed and no similar errors will occur again.




Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324594266&siteId=291194637