Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Jan 2008
    Posts
    3

    Default delete all files under a folder

    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. #2
    Member sitekeeper's Avatar
    Join Date
    Aug 2001
    Location
    Troy, Mo
    Posts
    60

    Default

    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

  3. #3
    Registered User
    Join Date
    Jan 2008
    Posts
    3

    Default

    Sorry I was not too clear; I am using CPanel so a line command won't work
    (I think so).

  4. #4
    Member sitekeeper's Avatar
    Join Date
    Aug 2001
    Location
    Troy, Mo
    Posts
    60

    Default

    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

  5. #5
    Registered User
    Join Date
    Jan 2008
    Posts
    3

    Default

    Quote Originally Posted by sitekeeper View Post
    The file manager in cpanel should work..
    Bob
    Yes, it works but is there a way to delete all files at once under a folder not to go one by one ?
    Last edited by mihaio; 01-29-2008 at 10:21 PM.

  6. #6
    Technical Product Specialist cPanelDavidG's Avatar
    Join Date
    Nov 2006
    Location
    Houston, TX
    Posts
    11,189
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by mihaio View Post
    Yes, it works but is there a way to delete all files at once under a folder not to go one by one ?
    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.

Similar Threads & Tags
Similar threads

  1. Can't delete a folder
    By masterfujin in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 02-07-2011, 12:48 PM
  2. Can't Delete Files ot Folder
    By Possumnz in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 10-04-2008, 05:48 PM
  3. Delete all files within a folder?
    By prettydumb in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 08-30-2007, 08:59 PM
  4. Dont delete this folder - folder interal data
    By ozzi4648 in forum cPanel and WHM Discussions
    Replies: 7
    Last Post: 06-27-2006, 10:18 AM
  5. I Can Delete /var/log/ this folder inside any files
    By lung3 in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 11-12-2002, 11:59 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube