0

I was moving files using Windows (had to at that time) from one NTFS partition to another but the computer switched off. Some files have been transferred, but some remain. I'm not able to delete them because they now have \n in the filename. I have a backup of the files, so I only want to delete the files.

  1. The output of ls -b shows me there are some \n characters in the filenames (1 folder + 2 PDF files)

    $ ls -b
    3316546202581         Rapid\ 3D\ Face\ Modeling\ using\ a\ Frontal\ Face\ and\ a\ Profile\ Face\ for\nAccurate\ 2D\ Pose\ Synthesis\n.pdf
    3D\ Face\ Reconstruction\ from\ Single\ 2D\ Image\ based\ on\ Robust\ Facial\nFeature\ Points\ Extraction\ and\ Generic\ Wire\ Frame\ Model\n.pdf
    
  2. Attempt to remove everything was in vain

    $ rm *
    rm: cannot remove `33316546202581': Is a directory
    rm: cannot remove `3D Face Reconstruction from Single 2D Image based on Robust Facial\nFeature Points Extraction and Generic Wire Frame Model\n.pdf': No such file or directory
    rm: cannot remove `Rapid 3D Face Modeling using a Frontal Face and a Profile Face for\nAccurate 2D Pose Synthesis\n.pdf': No such file or directory
    
  3. he output of ls -ali tells me the 2 PDF files have no INODES !!! Note that the first few lines of output actually goto newlines, while further down (last 2 lines) \n is shown as ?

    $ ls -ali
    ls: cannot access 3D Face Reconstruction from Single 2D Image based on Robust Facial
    Feature Points Extraction and Generic Wire Frame Model
    .pdf: No such file or directory
    ls: cannot access Rapid 3D Face Modeling using a Frontal Face and a Profile Face for
    Accurate 2D Pose Synthesis
    .pdf: No such file or directory
    total 12
     281474976785007 drwxrwxrwx+ 1 Administrators root 0 Oct  3 20:18 .
     281474976730073 drwxrwxrwx+ 1 Administrators root 0 Oct  3 20:18 ..
    1688849860279472 drwxrwxrwx+ 1 Administrators root 0 Oct  3 20:15 33316546202581
           ? -?????????? ? ?              ?    ?            ? 3D Face Reconstruction from Single 2D Image based on Robust Facial?Feature Points Extraction and Generic Wire Frame Model?.pdf
           ? -?????????? ? ?              ?    ?            ? Rapid 3D Face Modeling using a Frontal Face and a Profile Face for?Accurate 2D Pose Synthesis?.pdf
    

I rally want to delete these files. How do I do it?

  • Windows problems should be fixed with a Windows installation. Your disc is probably not in a safe state and needs to be cleaned (if memory serves me well then checkdsk /f is probably the Windows command). That will also clean your damaged files. Doing this from another OS than Windows is asking for more problems. – Rinzwind Oct 3 '14 at 19:47
0

The disk is likely corrupt, and causing alot of these issue - you may be able to resolve this by checking your disk for errors - this is possible using Windows [1] or Linux [2] [3]

However it may work if you escape the \s (place \ before each \ - also remember to "quote" the filenames as they have spaces in) e.g.

rm "3D Face Reconstruction from Single 2D Image based on Robust Facial\\nFeature Points Extraction and Generic Wire Frame Model\\n.pdf"

or using the -r option so rm recursivly removes directories, removing the 'Is a directory' error:

rm -r *

WARNING: Use the above command VERY carefully, otherwise it will delete loads of stuff

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.