Skip to content
Related Articles

Related Articles

Improve Article

Methods to clean temporary files from Ubuntu

  • Last Updated : 23 Jun, 2021

In this article we are going to learn how to clean temporary files from Ubuntu.
Let’s first see what exactly a temporary file.

Temporary file : 
A temporary file is a file created to hold information while a file is being created or modified.
Now let’s see why we need to clean or delete the temporary files.
Application programs often store temporary files on your computer’s hard drive.
They are supposed to be disposed of when the job or program, that it is finished. This is because it has become obsolete in the manual or save to shut down, resulting in a permanent record. They do not always delete themselves.

 After a period of time, these files can start to take up a lot of space. If you don’t have a lot of space on your hard-disk, cleaning up temporary files is a good way to free  up space on the hard disk.  

Now, let’s discuss some of the methods by which we can clean temporary files.

Method 1 :



  1. We can clean the temporary files using the command ” sudo apt-get autoremove “.
  2. Open the terminal type the command sudo apt-get autoremove.
  3. You will be prompted to enter your password and then hit enter.
  4. You are done. Temporary files are deleted.

using autoremove

Method 2 :

  1. We can clean the temporary files automatically.
  2. In the search bar, start typing privacy then you will be able to see a tab history and trash.
  3. Click on history and trash.
  4. Now toggle clean temporary files option to yes.
  5. Set the time period when to clean temporary files.
  6. You are done.

So now you don’t need to manually clean your temporary files, they will be automatically cleaned as per the time period you set.
You can also turn on the option to clean your trash files automatically.

Method 3 : 

  1. We can clean the temporary files using the command ” sudo apt-get autoclean “.
  2. Open the terminal type the command sudo apt-get autoclean.
  3. You will be prompted to enter your password and then hit enter.
  4. You are done. temporary files are deleted.

using autoclean command

Attention reader! Don’t stop learning now. Get hold of all the important CS Theory concepts for SDE interviews with the CS Theory Course at a student-friendly price and become industry ready.

 

My Personal Notes arrow_drop_up
Recommended Articles
Page :