Find the answer to your Linux question:
Results 1 to 3 of 3
Like Tree1Likes
  • 1 Post By gogalthorp
hey 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 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jun 2008
    Posts
    49

    command line to clear /tmp folder


    hey
    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
    Location
    West (by God) Virginia
    Posts
    3,104
    You can use the rm command to remove files and directories.

    type

    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.
    Landis likes this.

  3. #3
    Just Joined!
    Join Date
    Dec 2011
    Posts
    1
    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
    $spacer_close

Posting Permissions

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