How to delete files, leave folders?

I have a folder in my documents folder that I would like to clean up. It contains many folders and sub-folders (directories and sub-directories) in a many layers deep arrangement. I would like to delete only the files while preserving the folders and sub-folders (makes backing up and synchronising a LOT easier).
I am not using Time machine.
Help appreciated.
(If it is easier to just delete the main folder and then copy back just the folders from the back-up drive, please help me figure out how.)

Terminal session
find /path/to/starting/directory ! -type d -exec rm -f {} \;
As has been mentioned before, this is a dangerous operation, so MAKE SURE you have the starting directory correct.
Best to test first using
find /path/to/starting/directory ! -type d -ls
Then use the remove file version.

Similar Messages

  • How to move files between folders within Lightroom 3?

    I would like to move a file from one folder to another within Lightroom 3 (let's not discuss why). I searched the threads but couldn't find the answer (maybe I missed it). When I click on a photo within grid view then drag and drop that file onto a different folder in the folder panel (to do the move), a little plus sign (copy) appears and a copy of the file is placed in the second folder. If I try to delete the photo from the original folder (to get the move), both copies of the file are removed. I've tried holding down all sorts of keys on the imac but cannot get the move to work. Ideally, I'd like to move a group of photos but cannot even move one. Does anyone know how to move files between folders in Lightroom 3?

    Your suggestion works. Thank you for posting it.
        Ron
    2010/10/28 Dorin Nicolaescu-Musteață <[email protected]>
    Try selecting the photos, right-clicking the target folder and choosing
    "Move Selected Photos to This Folder".
    >

  • HOW TO DELETE FILES FROM ADOBE READER IF THEY ARE UNNECESSARY

    HOW TO DELETE FILES FROM ADOBE READER IF THEY ARE UNNECESSARY

    Hi,
    You might need to sign up at https://cloud.acrobat.com/ and choose 'Files' tab where you can find all the files.
    Select all the files you want to remove and choose 'Delete' option.
    Regards,
    Anubha

  • How to delete file manually from application data base

    Hi All,
    Could anyone tell me how to delete file manually from application database.
    Thanks In advance
    Regards
    SAN
    Edited by: Sanjay  Nair on Sep 2, 2008 10:51 AM

    Closed

  • How to delete file on ftp server

    hello,how to delete file on ftp server?thank you!

    I was trying to hint to the fact that you gave no where near enough information.
    Have you already written anything? Such as software that will connect to an FTP server?
    Are you using a 3rd party package?
    Are you doing it by hand, using sockets?

  • How to delete files in the YouTube downloader app?

    My Nokia Lumia 520 YouTube downloader how to delete files please give mi solution iam waiting
    Moderator's Note: We have moved your post and changed the title into a subject-related title. This is to keep the forum organized and let other forum users easily see and respond to this post.
    Solved!
    Go to Solution.

    You probably need to contact the developer of YouTube downloader for that.
    Moderator's Note: We have moved your post and changed the title into a subject-related title. This is to keep the forum organized and let other forum users easily see and respond to this post.

  • My Macbook Air can delete files and folders and take them to Trash Can but cannot delete from Trash Can . Cannot empty trash securely.

    My Macbook Air can delete files and folders and take them to Trash Can but cannot delete from Trash Can . Cannot empty trash securely.

    Launch the Console application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Console in the icon grid.
    Make sure the title of the Console window is All Messages. If it isn't, select All Messages from the SYSTEM LOG QUERIES menu on the left. If you don't see that menu, select
    View ▹ Show Log List
    from the menu bar.
    Click the Clear Display icon in the toolbar. Then try the action that you're having trouble with again. Select any messages that appear in the Console window. Copy them to the Clipboard by pressing the key combination command-C. Paste into a reply to this message by pressing command-V.
    When posting a log extract, be selective. In most cases, a few dozen lines are more than enough.
    Please do not indiscriminately dump thousands of lines from the log into this discussion.
    Important: Some private information, such as your name, may appear in the log. Anonymize before posting.

  • How to sort files and folders like Windows

    I don't know if this is specific to Arch or every other Linux distro but one thing that really bugs me in Arch is how files and folders are sorted. I use Windows as my main OS (don't start on that please) and I have one folder properly organized exactly as I want it and I like it how Windows sorts this. I access that same folder from my Arch installation, the problem is that the sorting is different and it gets on my nerves lol...
    This is how Windows sorts that specific folder:
    C:\Users\Nazgulled\Documents\University>dir /O
    Volume in drive C is Vista
    Volume Serial Number is F84E-02BE
    Directory of C:\Users\Nazgulled\Documents\University
    05-08-2009 15:34 <DIR> .
    05-08-2009 15:34 <DIR> ..
    05-08-2009 11:10 <DIR> [Archives]
    05-08-2009 14:38 <DIR> [Developers]
    05-08-2009 11:17 <DIR> [X] 1) Cálculo II
    05-08-2009 11:18 <DIR> [X] 2) Análise de Custos
    05-08-2009 11:18 <DIR> [X] 2) Cálculo de Programas
    05-08-2009 11:18 <DIR> [X] 2) Laboratórios de Informática III
    05-08-2009 11:18 <DIR> 2) Algoritmos e Complexidade
    05-08-2009 11:18 <DIR> 2) Arquitectura de Computadores
    05-08-2009 11:18 <DIR> 2) Comunicaçao de Dados
    05-08-2009 11:18 <DIR> 2) Engenharia Económica
    05-08-2009 11:18 <DIR> 2) Estatística Aplicada
    0 File(s) 0 bytes
    13 Dir(s) 24.700.485.632 bytes free
    And this is how Arch does it:
    nazgulled ~/University $ ls -l
    total 7
    drwxr-xr-x 1 nazgulled nazgulled 4096 2009-08-05 11:18 2) Algoritmos e Complexidade
    drwxr-xr-x 1 nazgulled nazgulled 4096 2009-08-05 11:18 2) Arquitectura de Computadores
    drwxr-xr-x 1 nazgulled nazgulled 4096 2009-08-05 11:18 2) Comunicação de Dados
    drwxr-xr-x 1 nazgulled nazgulled 4096 2009-08-05 11:18 2) Engenharia Económica
    drwxr-xr-x 1 nazgulled nazgulled 8192 2009-08-05 11:18 2) Estatística Aplicada
    drwxr-xr-x 1 nazgulled nazgulled 4096 2009-08-05 11:10 [Archives]
    drwxr-xr-x 1 nazgulled nazgulled 4096 2009-08-05 14:38 [Developers]
    drwxr-xr-x 1 nazgulled nazgulled 4096 2009-08-05 11:17 [X] 1) Cálculo II
    drwxr-xr-x 1 nazgulled nazgulled 12288 2009-08-05 11:18 [X] 2) Análise de Custos
    drwxr-xr-x 1 nazgulled nazgulled 4096 2009-08-05 11:18 [X] 2) Cálculo de Programas
    drwxr-xr-x 1 nazgulled nazgulled 4096 2009-08-05 11:18 [X] 2) Laboratórios de Informática III
    How can I get Arch/Linux to sort exactly the same as Windows?
    Last edited by Nazgulled (2009-08-05 14:41:47)

    toad wrote:
    Nazgulled wrote:Surely there must be a way to have the same sorting collation in Linux like in Windows
    Ah, no. The way they are doing it is nonsensical and not good practice for a unix style system. Having said that, some solutions have already been offered in this thread.
    While you are free to continue to ask others to help you achieve your aims, it may be more convenient for you to adapt to a structure that is displayed the same way under all systems (just to avoid frustration - not saying you _should_ do it ).
    I really don't care if it's nonsensical, I use Windows 95% of the time or more, it's my main OS, I'm used to it and I like it. Why should I care if it's not a good practice for a unix style system? I just want things to behave the way I like and for a free system like Linux where it doesn't even compare to Windows in terms of freedom in what I can do with it and configure the way I like, it sure is hard to change the way folders/files are sorted...
    It sucks that there isn't a proper solution but I'm not going to adapt anything, that would be nonsensical... But if I have to, I can live with the fact that there isn't a good solution and leave it as it is
    Thanks everyone for their input, "topic closed".

  • I am having trouble deleting files and folders after creating in the same .VI

    I have a larger .VI that runs an automated balancing routine for a large rotating mass.  The test needs to create some folders and files so that as the rest is run multiple times, there is a way to track how units did under test and when they were tested.
    The attached .VI is only the portion of the code that creates the files and folders, waits for user input, and then deletes them if the test is cancelled before data is collected.  There are other elements, but they are irrelevant given that I can't even get the stripped down code to work.  I have checked the permissions on the deepest file (within both folders) and I am unable to get 777(oct) permissions on this file which could be the only problem I have.  Does anyone have any suggestions?
    Attachments:
    test1.vi ‏47 KB

    Here are a couple of things:
    Frame 0: the pane properties are saved with the file, so once they are set you never need to set them again. Delete the property node and associated constants.
    Frame 1:
    Shouldn't "Serial#" be a control (and an integer)? You do a complex song and dance to add leading zeroes. Simply format your serial number with format "%04d"
    Shouldn't "Operator" be a control?
    Frame 2: That loop needs a small wait statement. Since STOP is always true when the loop ends, the later case structure seems unneeded.
    Frame 3:
    the STOP function seems unneeded. the VI will stop anyway since there is no code left.
    never use default tunnels for references.
    All your error outputs are "disconnected" and write to the same indicator. Mist likely you'll loose intermediary errors.
    Overall, you should use a state machine architecture instead of sequences. It will be much more flexible and will take even less diagram space. The indicators can be outside the state case, so all states can write to them. No locals needed.
    LabVIEW Champion . Do more with less code and in less time .

  • How to delete file from client machine

    Hi all,
    we are using the DataBase: oracle:10g,
    and forms/reports 10g(developer suite 10g-10.1.2.2).
    can anybody help me how to delete the file from client machine in specified location using webutil or any
    (i tried with webutil_host & client_host but it is working for application server only)
    thank you.

    hi
    check this not tested.
    PROCEDURE OPEN_FILE (V_ID_DOC IN VARCHAR2)
    IS
    -- Open a stored document --
    LC$Cmd Varchar2(1280) ;
    LC$Nom Varchar2(1000) ;
    LC$Fic Varchar2(1280);
    LC$Path Varchar2(1280);
    LC$Sep Varchar2(1) ;
    LN$But Pls_Integer ;
    LB$Ok Boolean ;
    -- Current Process ID --
    ret WEBUTIL_HOST.PROCESS_ID ;
    V_FICHERO VARCHAR2(500);
    COMILLA VARCHAR2(4) := '''';
    BOTON NUMBER;
    MODO VARCHAR2(50);
    URL VARCHAR2(500);
    Begin
    V_FICHERO := V_ID_DOC;
    LC$Sep := '\';--WEBUTIL_FILE.Get_File_Separator ; -- 10g
    LC$Nom := V_FICHERO;--Substr( V_FICHERO, instr( V_FICHERO, LC$Sep, -1 ) + 1, 100 ) ;
    --LC$Path := CLIENT_WIN_API_ENVIRONMENT.Get_Temp_Directory ;
    LC$Path := 'C:';
    LC$Fic := LC$Path || LC$Sep || LC$Nom ;
    If Not webutil_file_transfer.DB_To_Client
    LC$Fic,
    'TABLE_NAME',
    'ITEM_NAME',
    'WHERE'
    ) Then
    Raise Form_trigger_Failure ;
    End if ;
    LC$Cmd := 'cmd /c start "" /MAX /WAIT "' || LC$Fic || '"' ;
    Ret := WEBUTIL_HOST.blocking( LC$Cmd ) ;
    LN$But := WEBUTIL_HOST.Get_return_Code( Ret ) ;
    If LN$But 0 Then
    Set_Alert_Property( 'ALER_STOP_1', TITLE, 'Host() command' ) ;
    Set_Alert_Property( 'ALER_STOP_1', ALERT_MESSAGE_TEXT, 'Host() command error : ' || To_Char( LN$But ) ) ;
    LN$But := Show_Alert( 'ALER_STOP_1' ) ;
    LB$Ok := WEBUTIL_FILE.DELETE_FILE( LC$Fic ) ;
    Raise Form_Trigger_Failure ;
    End if ;
    If Not webutil_file_transfer.Client_To_DB
    LC$Fic,
    'TABLE_NAME',
    'ITEM_NAME',
    'WHERE'
    ) Then
    NULL;
    Else
    Commit ;
    End if ;
    LB$Ok := WEBUTIL_FILE.DELETE_FILE( LC$Fic ) ;
    Exception
    When Form_Trigger_Failure Then
    Raise ;
    End ;sarah

  • How to delete  File from the Application Server,ABAP

    Hi Gurus,
    I'm using  DELETE  DATASET  Statement ,
    Based on Date  how can i delete files with in the period in the Application server
    Any BAPI/FM  for this Delete file based  on some Date Period
    Thanks in Advance.

    DATA: BEGIN OF file,
            dirname(75) TYPE c, " name of directory. (possibly truncated.)
            name(75)    TYPE c, " name of entry. (possibly truncated.)
            type(10)    TYPE c,            " type of entry.
            len(8)      TYPE p,            " length in bytes.
            owner(8)    TYPE c,            " owner of the entry.
            mtime(6)    TYPE p, " last modification date, seconds since 1970
            mode(9)     TYPE c, " like "rwx-r-x--x": protection mode.
            useable(1)  TYPE c,
            subrc(4)    TYPE c,
            errno(3)    TYPE c,
            errmsg(40)  TYPE c,
            mod_date    TYPE d,
            mod_time(8) TYPE c,            " hh:mm:ss
            seen(1)     TYPE c,
            changed(1)  TYPE c,
          END OF file.
    DATA: BEGIN OF file_list OCCURS 100,
            dirname(75) TYPE c, " name of directory. (possibly truncated.)
            name(75)    TYPE c, " name of entry. (possibly truncated.)
            type(10)    TYPE c,            " type of entry.
            len(8)      TYPE p,            " length in bytes.
            owner(8)    TYPE c,            " owner of the entry.
            mtime(6)    TYPE p, " last modification date, seconds since 1970
            mode(9)     TYPE c, " like "rwx-r-x--x": protection mode.
            useable(1)  TYPE c,
            subrc(4)    TYPE c,
            errno(3)    TYPE c,
            errmsg(40)  TYPE c,
            mod_date    TYPE d,
            mod_time(8) TYPE c,            " hh:mm:ss
            seen(1)     TYPE c,
            changed(1)  TYPE c,
          END OF file_list.
      DO.
        CLEAR file.                           
        CALL 'C_DIR_READ_NEXT'
          ID 'TYPE'   FIELD file-type
          ID 'NAME'   FIELD file-name
          ID 'LEN'    FIELD file-len
          ID 'OWNER'  FIELD file-owner
          ID 'MTIME'  FIELD file-mtime
          ID 'MODE'   FIELD file-mode
          ID 'ERRNO'  FIELD file-errno
          ID 'ERRMSG' FIELD file-errmsg.
       if sy-subrc eq 0.
          MOVE-CORRESPONDING file TO file_list.
          APPEND file_list.
       else.
          exit.
       endif.
    enddo.
    sort file_list based on date and time ie, MOD_DATE and MOD_TIME fields
    and delete the entries

  • How to delete file names from Adobe Reader list

    How can I delete file names from the Adobe Reader list?  I have deleted the file & it's empty, but deleted file names remain in my list & it's very annoying.  I can't seem to find an option anywhere to delete the file names.

    Thanks for the answer, I will try this & post my results with this method.  I have set the amount to zero, & it seems if I want to put back valid files into my list I first need to find them in another file in my pc, such as documents, open them in Adobe Reader, & then then they will reappear in the Adobe Reader list.  Is this correct?  Thank you!
    This seems to be the case, you need to restore each file you want in your list one by one by accessing them elsewhere on your pc, & then you must open them with Adobe Reader to have files reappear in your Adobe Reader list.  However, this seems to be a tedious process if you only want to delete one obsolete file from your list by first emptying the list & rebuilding it file by file.  It works, but I'm wondering if there is a more sensible & efficient way to do this?

  • How to delete file systems from a Live Upgrade environment

    How to delete non-critical file systems from a Live Upgrade boot environment?
    Here is the situation.
    I have a Sol 10 upd 3 machine with 3 disks which I intend to upgrade to Sol 10 upd 6.
    Current layout
    Disk 0: 16 GB:
    /dev/dsk/c0t0d0s0 1.9G /
    /dev/dsk/c0t0d0s1 692M /usr/openwin
    /dev/dsk/c0t0d0s3 7.7G /var
    /dev/dsk/c0t0d0s4 3.9G swap
    /dev/dsk/c0t0d0s5 2.5G /tmp
    Disk 1: 16 GB:
    /dev/dsk/c0t1d0s0 7.7G /usr
    /dev/dsk/c0t1d0s1 1.8G /opt
    /dev/dsk/c0t1d0s3 3.2G /data1
    /dev/dsk/c0t1d0s4 3.9G /data2
    Disk 2: 33 GB:
    /dev/dsk/c0t2d0s0 33G /data3
    The data file systems are not in use right now, and I was thinking of
    partitioning the data3 into 2 or 3 file systems and then creating
    a new BE.
    However, the system already has a BE (named s10) and that BE lists
    all of the filesystems, incl the data ones.
    # lufslist -n 's10'
    boot environment name: s10
    This boot environment is currently active.
    This boot environment will be active on next system boot.
    Filesystem fstype device size Mounted on Mount Options
    /dev/dsk/c0t0d0s4 swap 4201703424 - -
    /dev/dsk/c0t0d0s0 ufs 2098059264 / -
    /dev/dsk/c0t1d0s0 ufs 8390375424 /usr -
    /dev/dsk/c0t0d0s3 ufs 8390375424 /var -
    /dev/dsk/c0t1d0s3 ufs 3505453056 /data1 -
    /dev/dsk/c0t1d0s1 ufs 1997531136 /opt -
    /dev/dsk/c0t1d0s4 ufs 4294785024 /data2 -
    /dev/dsk/c0t2d0s0 ufs 36507484160 /data3 -
    /dev/dsk/c0t0d0s5 ufs 2727290880 /tmp -
    /dev/dsk/c0t0d0s1 ufs 770715648 /usr/openwin -
    I browsed the Solaris 10 Installation Guide and the man pages
    for the lu commands, but can not find how to remove the data
    file systems from the BE.
    How do I do a live upgrade on this system?
    Thanks for your help.

    Thanks for the tips.
    I commented out the entries in /etc/vfstab, also had to remove the files /etc/lutab and /etc/lu/ICF.1
    and then could create the Boot Environment from scratch.
    I was also able to create another boot environment and copied into it,
    but now I'm facing a different problem, error when trying to upgrade.
    # lustatus
    Boot Environment           Is       Active Active    Can    Copy     
    Name                       Complete Now    On Reboot Delete Status   
    s10                        yes      yes    yes       no     -        
    s10u6                      yes      no     no        yes    -        Now, I have the Solaris 10 Update 6 DVD image on another machine
    which shares out the directory. I mounted it on this machine,
    did a lofiadm and mounted that at /cdrom.
    # ls -CF /cdrom /cdrom/boot /cdrom/platform
    /cdrom:
    Copyright                     boot/
    JDS-THIRDPARTYLICENSEREADME   installer*
    License/                      platform/
    Solaris_10/
    /cdrom/boot:
    hsfs.bootblock   sparc.miniroot
    /cdrom/platform:
    sun4u/   sun4us/  sun4v/Now I did luupgrade and I get this error:
    # luupgrade -u -n s10u6 -s /cdrom    
    ERROR: The media miniroot archive does not exist </cdrom/boot/x86.miniroot>.
    ERROR: Cannot unmount miniroot at </cdrom/Solaris_10/Tools/Boot>.I find it strange that this sparc machine is complaining about x86.miniroot.
    BTW, the machine on which the DVD image is happens to be x86 running Sol 10.
    I thought that wouldn't matter, as it is just NFS sharing a directory which has a DVD image.
    What am I doing wrong?
    Thanks.

  • How to delete files from time machine volume

    Before selling my old MacBook Pro, I had backed up all my data on to an external WD hard drive using Time Machine. I had since switched to a desktop but since I did not have any need for the MacBook Pro files at the time, I had put aside that WD hard drive. Recently, I wanted to clear some space on that external drive to make way for some of my present files. I drilled down in to Backups.backupdb and tried to delete files, but was met with the error "
    An error occurred.The operation couldn’t be completed. (OSStatus error -5000.) Insufficient access privileges for operation".
    It did prompt me for a username and password before showing that message. I tried both my current user/pass as well as (what I remember to be) my old user/pass on the MacBook Pro. Both presented me with the same error message.
    I also did try to mount the drive as Time Machine on my present system, and then try to enter Time Machine and delete it from there. However, clicking on "Enter Time Machine ... " does nothing.
    Any ideas?

    Hi Linc,
    my back-up data is managed by Time Machine; the actual data is on a second internal Hard Drive with a capacity of 1TB - not partitioned. I am using Time Machine and have access to all data backed up since Mavericks Clean Install but not the data prior to this date.
    When I open the 1TB drive in Finder I can see a folder "Backups.backupdb/Sigi's Mac Pro/ followed by many folders of backup dates going back to 2010-09-20-103441 and up to 2014-02-07-142414 all followed with folder Macintosh HD.  February 7th  2014 was the date of the clean install.
    These Backups are followed by backup date folder 2014-02-08-075554 with a subfolder of MacPro-320GB (this is the name I assigned to my Boot Drive during formatting; I suspect I should have assigned the same name as before ie. Macintosh HD) and 2014-02-11 with a subfolder Macintosh HD, these are the ones I get access to by way of Time Machine > Restore.
    Weird thing is on Febr 11 when I relised my possible mistake and renamed the Bootdrive back to what it was initially ie. Macintosh HD despite this I have access to all backup data since the Clean Install in both folders MacPro-320GB as well as Macintosh HD but not to any data prior to the Clean Install.
    Is there something that Time Machine knows and prevents access or is it simply a matter of renaming the subfolder 2014-02-08-07554/MacPro-320GB to ........./Macintosh HD?
    I like to restore selectively and not everything - It was hard work reinstalling apps that were supposed to be the troublemakers (ref my discussion on Maverick problems) but I now need to get onto data specific to some of these apps as well as other data I may have missed. Long story? Yes and sorry.
    Sigi

  • HOw to delete files from remote server?

    Hi,
    I want to delete files from a directory on remote server.
    I use the following command to delete on current server:
    find $srcdir -mtime +90 -name "COR*.txt" -exec rm -f {} \;
    Now, how can I delete files from remote server ?
    Thanks!
    Yogini

    Some possible options:
    1. There exists SSH implementation for Windows.
    2. You can make a workaround. You can setup share for specific/wanted directory.
    Then you can mount it on Linux machine and execute command localy and delete files "localy" in mounted directory.
    3. You can setup FTP server on Windows machine and do that remotely via FTP commands.

Maybe you are looking for

  • Tax Issue in MIRO

    Hello SAP Scholars, When I try to post an invoice in MIRO, some amount is hitting BSX (stock account). Tax code I1 (4%) has been given in PO so logically there should be 3 accounts: 1) Reconciliation account 2) GR/IR account 3) Tax account but when I

  • Pattern Swatch Alignment

    Greetings! I've been trying to figure out how some patterns I've been working on are deciding how to align themselves. I have a set of patterns that alter in size. 25 of them. I am adding these to a set of radial circles. On 20/25 of them, everything

  • IIS ARR Question

    Is it possible to publish multiple sites on 443. I have at least two sites that I want to reverse proxy and use port 443 and they use different certificates. OWA and Web Apps.

  • Images in NetBeans 5.0 Mobility

    Hi all, I am an experienced programmer but new to Java. I want to learn how to program MIDlet's for mobile phones. I have installed NetBeans 5.0 and the NetBeans Mobility Pack for supporting mobile applications. I have learned the basics like creatin

  • Records alternate between non drop frame and drop frame...

    I am seeing a pattern with Premiere records, that alternate the records from being non drop frame to drop frame.  So one day we recorded 7 segments.  The records ended up coming out like this (without any changes being made between records): Segment