0

My site is experiencing Internal server Errors, website shutdowns and the main cause is a full /temp directory. The support gave us a list of large temp files that come with a size exceeding 1 GB. Is there any way to delete specific files in /temp?

ls -lah /tmp

I've used this code to go to my /temp file. How can I delete specific files in it?

Dominique
  • 16,450
  • 15
  • 56
  • 112

2 Answers2

0

Change directory to tmp - cd /tmp

And delete specific files - rm -f specific.file.name

Vitaliy
  • 16
0

You can use find for that:

find /temp -size +1G -delete

This means the following:

/temp     : location of the search (subfolders are searched too)
-size +1G : the size should be larger than 1Gb
-delete   : once such a file is found, delete it.
Dominique
  • 16,450
  • 15
  • 56
  • 112