Page 1 of 5 123 ... LastLast
Results 1 to 10 of 45

Thread: Cannot delete a file

  1. #1

    Default Cannot delete a file

    opensuse v12.1
    linux 3.1.0-1.2-desktop x86_64

    How do I delete a file that cannot be seen? Apparently a mystery character has been added to a filename and none of the normal methods can handle it.

    Code:
    root:..Indexes/LabyrinthIndex> ll
    ls: cannot access versi�: No such file or directory
    total 0
    -????????? ? ? ? ?            ? versi?
    
    root:..Indexes/LabyrinthIndex> mv versi* versi-x
    mv: cannot stat `versi\377': No such file or directory
    
    root:..Indexes/LabyrinthIndex> rm -fr vers* 
    
    root:..Indexes/LabyrinthIndex> ll
    ls: cannot access versi�: No such file or directory
    total 0
    -????????? ? ? ? ?            ? versi?

  2. #2
    Join Date
    Jun 2008
    Location
    Earth - Denmark
    Posts
    10,730

    Default Re: Cannot delete a file

    On 01/18/2012 07:56 PM, jimoe666 wrote:
    >
    > How do I delete a file that cannot be seen?


    install mc and see if you can't F8 delete it..

    --
    DD
    openSUSE®, the "German Engineered Automobiles" of operating systems!

  3. #3
    Join Date
    Feb 2010
    Location
    Germany
    Posts
    4,654

    Default Re: Cannot delete a file

    You can try that
    http://www.cyberciti.biz/tips/delete...de-number.html

    --
    PC: oS 11.4 (dual boot 12.1) 64 bit | Intel Core i7-2600@3.40GHz | KDE
    4.6.0 | GeForce GT 420 | 16GB Ram
    Eee PC 1201n: oS 11.4 64 bit | Intel Atom 330@1.60GHz | KDE 4.7.4 |
    nVidia ION | 3GB Ram

  4. #4
    Join Date
    Jul 2008
    Location
    Seattle, WA
    Posts
    17,078

    Default Re: Cannot delete a file

    On Wed, 18 Jan 2012 18:56:03 +0000, jimoe666 wrote:

    > opensuse v12.1 linux 3.1.0-1.2-desktop x86_64
    >
    > How do I delete a file that cannot be seen? Apparently a mystery
    > character has been added to a filename and none of the normal methods
    > can handle it.


    I might be inclined to dismount the filesystem and run a fsck on it.
    What you see in your ll output doesn't look normal, and looks more like a
    corrupt directory entry.

    Jim
    --
    Jim Henderson
    openSUSE Forums Administrator
    Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C

  5. #5

    Default Re: Cannot delete a file

    >
    > How do I delete a file that cannot be seen?

    install mc and see if you can't F8 delete it.
    No, that did not work. mc listed the file but complained that file did not exist to delete.

  6. #6

    Default Re: Cannot delete a file

    Quote Originally Posted by martin_helm View Post
    No, that did not work.
    Code:
    root:..Indexes/LabyrinthIndex> stat vers*
    stat: cannot stat `versi\377': No such file or directory

  7. #7

    Default Re: Cannot delete a file

    Quote Originally Posted by hendersj View Post
    On Wed, 18 Jan 2012 18:56:03 +0000, jimoe666 wrote:

    > How do I delete a file that cannot be seen? Apparently a mystery
    > character has been added to a filename and none of the normal methods
    > can handle it.


    I might be inclined to dismount the filesystem and run a fsck on it.
    What you see in your ll output doesn't look normal, and looks more like a
    corrupt directory entry.
    I'll have to boot to a rescue disk to do this, I guess. I do not think I can dismount the /home filesystem since it is in use.

  8. #8
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,270

    Default Re: Cannot delete a file

    Of course you can umount /home. But indeed only when you do not use it.

    Thus log out as user (from the GUI I assume), Let all other users log out when you accomodate them.

    Do Ctrl-Alt-F1 and you land at the console. There is a login. Log in as root. This is one of the very seldom cases that you may login as root directly, local (vs. remote) and on the console itself (not much change that anybody taps your passwd, close doors and windows).

    Now see if you can
    Code:
    umount /home
    If that succeeds, you know apparently how to fsck.

    When umount does not work, you can go to runlevel 1 with
    Code:
    init 1
    Now it must be possible.
    Henk van Velden

  9. #9
    Join Date
    Feb 2010
    Location
    Germany
    Posts
    4,654

    Default Re: Cannot delete a file

    Am 18.01.2012 20:36, schrieb jimoe666:
    >
    > martin_helm;2431759 Wrote:
    >> You can try that
    >> 'How to: Linux / UNIX Delete or Remove Files With Inode Number'
    >> (http://tinyurl.com/ygtaqmq)

    > No, that did not work.
    >
    > Code:
    > --------------------
    > root:..Indexes/LabyrinthIndex> stat vers*
    > stat: cannot stat `versi\377': No such file or directory
    > --------------------
    >
    >

    Try "ls -i" without giving a file name what does not work for you is the
    shell expansion of *

    --
    PC: oS 11.4 (dual boot 12.1) 64 bit | Intel Core i7-2600@3.40GHz | KDE
    4.6.0 | GeForce GT 420 | 16GB Ram
    Eee PC 1201n: oS 11.4 64 bit | Intel Atom 330@1.60GHz | KDE 4.7.4 |
    nVidia ION | 3GB Ram

  10. #10
    Join Date
    Jan 2012
    Location
    BC
    Posts
    178

    Lightbulb Re: Cannot delete a file

    If you want to delete a file with non-printable characters or no name, you might be able to use rm.

    1.) Use ls to make sure the file name is correct (ls will output it if found):
    Code:
    ls -l $'versi\377'
    2.) When ls shows you that that is the correct file, delete it with rm:
    Code:
    rm $'versi\377'

Page 1 of 5 123 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •