Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

delete all files under a folder

Discussion in 'General Discussion' started by mihaio, Jan 27, 2008.

  1. mihaio

    mihaio Registered

    Joined:
    Jan 27, 2008
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    51
    Hello,

    I'd like to clean up some space, for example from
    tmp/analog and tmp/urchin as I'm getting close to the maximum disk quota for my hosting account.

    I tried to look for it, I searched this forum as well but I do not know how to delete all files under a folder (I do not want to go one by one as there are too many) .

    "Delete this folder and all files under it" is a command I do not want to use as I do not know whether those folders are required or not.

    To cut a long story short is there a way to delete all files under a folder at once ?

    Thanks
     
  2. sitekeeper

    sitekeeper Well-Known Member

    Joined:
    Aug 13, 2001
    Messages:
    60
    Likes Received:
    0
    Trophy Points:
    306
    Location:
    Troy, Mo
    rm filename.txt : deletes filename.txt, will more than likely ask if you really want to delete it
    rm -f filename.txt : deletes filename.txt, will not ask for confirmation before deleting.
    rm -rf tmp/ : recursively deletes the directory tmp, and all files in it, including subdirectories. BE VERY CAREFULL WITH THIS COMMAND!!!

    Bob
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. mihaio

    mihaio Registered

    Joined:
    Jan 27, 2008
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    51
    Sorry I was not too clear; I am using CPanel so a line command won't work
    (I think so).
     
  4. sitekeeper

    sitekeeper Well-Known Member

    Joined:
    Aug 13, 2001
    Messages:
    60
    Likes Received:
    0
    Trophy Points:
    306
    Location:
    Troy, Mo
    The file manager in cpanel should work.. But you may not be able to delete some things in /username Be sure to empty the trash once your sure you have everything deleted correctly.

    Bob
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. mihaio

    mihaio Registered

    Joined:
    Jan 27, 2008
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    51
    Yes, it works but is there a way to delete all files at once under a folder not to go one by one ?
     
    #5 mihaio, Jan 29, 2008
    Last edited: Jan 29, 2008
  6. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,216
    Likes Received:
    10
    Trophy Points:
    313
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    If you are using the X3 theme and "File Manager", you should be able to delete all contents of a folder by dragging a box around all the files/folders you wish to delete rather than deleting one at a time.

    This cannot be done using Legacy File Manager or the File Manager in the old X and X2 themes.
     
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice