Find the answer to your Linux question:
Results 1 to 3 of 3
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    command line to clear /tmp folder

    im back and i have installed opensuse 11.0 on the computer to make it easier to solve problems but no dual boot because my dad just doesn't want to install xp to much problems.

    so we are still on linux.

    here is the question, is there a way to clean the /tmp folder using the terminal.

  2. #2
    Linux Guru gogalthorp's Avatar
    Join Date
    Oct 2006
    West (by God) Virginia
    You can use the rm command to remove files and directories.


    info rm

    to see all the options.

    Also be aware that file ownership is important. ie if you don't have read/write permissions on a file you can not remove it. Also /tmp may have files that are locked due to them being in use.

    DO NOT remove the /tmp directory itself. It is required for proper operation!

    Be very careful when using the rm command as root you can erase the whole OS if you are not very very careful.

  3. #3
    Use this command :

    tmpwatch --mtime --all 240 /tmp

    Note that 240 = 24 * 10 days ,you can adjust value as per your wish

  4. $spacer_open

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts