The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Remove All home/username/.trash file

Discussion in 'General Discussion' started by Mehrpouyan, Oct 15, 2015.

  1. Mehrpouyan

    Mehrpouyan Active Member

    Joined:
    Nov 5, 2012
    Messages:
    26
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hello,
    how can i delete all content of .trash folders for all users ?

    can i use this command ?

    find /home/*/.trash/* -exec rm {} \;

    please help with a secure command to just remove content of all .trash folders.

    Best Regards,
     
  2. Mehrpouyan

    Mehrpouyan Active Member

    Joined:
    Nov 5, 2012
    Messages:
    26
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    or ?

    find /home/*/.trash/* -exec rm -rf {} \;

    please help me with correct and safe command :)
     
  3. 24x7server

    24x7server Well-Known Member

    Joined:
    Apr 17, 2013
    Messages:
    1,146
    Likes Received:
    34
    Trophy Points:
    48
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Yes, You can use following command to remove all files and folder from user's .trash directory.

    Code:
    find /home/*/.trash/* -exec rm -rf {} \;
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    654
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    Could you verify that it's a .trash directory in an account's home directory that you want to remove and not email that's been moved to a trash directory associated with an IMAP folder?

    Thank you.
     
  5. Mehrpouyan

    Mehrpouyan Active Member

    Joined:
    Nov 5, 2012
    Messages:
    26
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Yes i want remove contents of all .trash folders in /home directory ( not emails )

    Best Regards,
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    654
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    You can use a command like the one referenced in the earlier post, however you may want to run the "find" command on it's own first to verify it lists the files you actually want removed.

    Thank you.
     
Loading...

Share This Page