Help Center

Delete unnecessary files from the /tmp partition

The /tmp partition on a Linux server is used to temporarily store files while various tasks are running. It's important to ensure that this partition doesn't fill up, as it can affect system performance and lead to unexpected issues.

In this tutorial, we will show you how to delete files from the last 12 hours in the /tmp partition. By freeing up space in this partition, you ensure efficient operation of your server and avoid potential errors or interruptions.

Follow the instructions below to clean the /tmp partition and keep your server in optimal condition. Remember to exercise caution when deleting files and make sure you don't need any important data that may be stored in the partition.

Simply log in via SSH and execute the following command:

tmpwatch -am 12 /tmp

This will delete all files older than 12 hours, meaning it will only retain files from the past 12 hours at the time of execution, and the rest will be discarded.


Ready! You have deleted files from the last 12 hours in the /tmp partition of your Linux server. This procedure can help free up disk space and maintain the optimal performance of your server. Remember to exercise caution when performing file deletion operations to avoid accidentally deleting important data.

Last updated: 25 de abril de 2024

Estimated reading time: 2 minutes

Did this article help you?
Let's Do It!

Start TODAY for only $2.45/month

Includes a web builder, 30GB of cloud storage, +200 Apps, and professional email.

Sign Up Now