Results 1 to 10 of 10

Thread: Delete files with | in filename (using Win10 bash)

  1. #1
    Join Date
    Oct 2009
    Beans
    6

    Delete files with | in filename (using Win10 bash)

    Hello, although I'm using Ubuntu bash on Windows 10 I think this a general Ubuntu question.

    A friend has a Windows 10 PC with a hard drive that has some files that he can't delete. He reckons at some time in the past the drive was in a Ubuntu PC and he thinks he saved some Firefox bookmarks to it as files.

    The files all appear to have a vertical line | in the filenames. Four have colons, one doesn't. All have spaces.

    UK keyboard.
    When I'm in bash I get what appears to be an identical | by pressing Shift-\ near the bottom left, even though the key has ¦ printed on it.
    Altgr-` at the top left gives ¦ even though the key has | printed on it.

    I've installed bash on the computer and tried to delete the files from there, but with no luck.

    I'm beginning to think it would be quicker to copy the terabyte or so of data he needs off the drive, format it, and copy it all back

    Below is what I've tried.

    They are in a folder called 1 within a folder called DeleteMe. There's another folder called 2 with identical files.

    Can anyone help? Thanks

    Code:
    dazzi@DAZZIBOX:/mnt/e/DeleteMe/1$ ls
    ls: cannot access Acronis Disk Director 11 Home: Changing from Demo to Full Version | Knowledge Base.desktop: No such file or directory
    ls: cannot access Acronis Disk Director 11 Home: Creating Acronis Bootable Media | Knowledge Base.desktop: No such file or directory
    ls: cannot access Acronis Disk Director 11 Home: Creating WinPE-Based Acronis Bootable Media | Knowledge Base.desktop: No such file or directory
    ls: cannot access Acronis Disk Director 11 Home: Installation of a Demo Version | Knowledge Base.desktop: No such file or directory
    ls: cannot access How to Delete an MBR Partition From a Hard Drive | eHow.com.desktop: No such file or directory
    Acronis Disk Director 11 Home: Changing from Demo to Full Version | Knowledge Base.desktop
    Acronis Disk Director 11 Home: Creating Acronis Bootable Media | Knowledge Base.desktop
    Acronis Disk Director 11 Home: Creating WinPE-Based Acronis Bootable Media | Knowledge Base.desktop
    Acronis Disk Director 11 Home: Installation of a Demo Version | Knowledge Base.desktop
    How to Delete an MBR Partition From a Hard Drive | eHow.com.desktop
    Code:
    dazzi@DAZZIBOX:/mnt/e/DeleteMe/1$ ls -b
    ls: cannot access Acronis Disk Director 11 Home\: Changing from Demo to Full Version | Knowledge Base.desktop: No such file or directory
    ls: cannot access Acronis Disk Director 11 Home\: Creating Acronis Bootable Media | Knowledge Base.desktop: No such file or directory
    ls: cannot access Acronis Disk Director 11 Home\: Creating WinPE-Based Acronis Bootable Media | Knowledge Base.desktop: No such file or directory
    ls: cannot access Acronis Disk Director 11 Home\: Installation of a Demo Version | Knowledge Base.desktop: No such file or directory
    ls: cannot access How to Delete an MBR Partition From a Hard Drive | eHow.com.desktop: No such file or directory
    Acronis\ Disk\ Director\ 11\ Home:\ Changing\ from\ Demo\ to\ Full\ Version\ |\ Knowledge\ Base.desktop
    Acronis\ Disk\ Director\ 11\ Home:\ Creating\ Acronis\ Bootable\ Media\ |\ Knowledge\ Base.desktop
    Acronis\ Disk\ Director\ 11\ Home:\ Creating\ WinPE-Based\ Acronis\ Bootable\ Media\ |\ Knowledge\ Base.desktop
    Acronis\ Disk\ Director\ 11\ Home:\ Installation\ of\ a\ Demo\ Version\ |\ Knowledge\ Base.desktop
    How\ to\ Delete\ an\ MBR\ Partition\ From\ a\ Hard\ Drive\ |\ eHow.com.desktop
    Code:
    dazzi@DAZZIBOX:/mnt/e/DeleteMe/1$ rm Acronis\ Disk\ Director\ 11\ Home:\ Changing\ from\ Demo\ to\ Full\ Version\ |\ Knowledge\ Base.desktop
    rm: cannot remove ‘Acronis Disk Director 11 Home: Changing from Demo to Full Version ’: No such file or directory
     Knowledge Base.desktop: command not found
    This was a direct copy and paste from the ls -b output.

    Code:
    dazzi@DAZZIBOX:/mnt/e/DeleteMe/1$ ls -l
    ls: cannot access Acronis Disk Director 11 Home: Changing from Demo to Full Version | Knowledge Base.desktop: No such file or directory
    ls: cannot access Acronis Disk Director 11 Home: Creating Acronis Bootable Media | Knowledge Base.desktop: No such file or directory
    ls: cannot access Acronis Disk Director 11 Home: Creating WinPE-Based Acronis Bootable Media | Knowledge Base.desktop: No such file or directory
    ls: cannot access Acronis Disk Director 11 Home: Installation of a Demo Version | Knowledge Base.desktop: No such file or directory
    ls: cannot access How to Delete an MBR Partition From a Hard Drive | eHow.com.desktop: No such file or directory
    total 0
    -????????? ? ? ? ?            ? Acronis Disk Director 11 Home: Changing from Demo to Full Version | Knowledge Base.desktop
    -????????? ? ? ? ?            ? Acronis Disk Director 11 Home: Creating Acronis Bootable Media | Knowledge Base.desktop
    -????????? ? ? ? ?            ? Acronis Disk Director 11 Home: Creating WinPE-Based Acronis Bootable Media | Knowledge Base.desktop
    -????????? ? ? ? ?            ? Acronis Disk Director 11 Home: Installation of a Demo Version | Knowledge Base.desktop
    -????????? ? ? ? ?            ? How to Delete an MBR Partition From a Hard Drive | eHow.com.desktop
    Code:
    dazzi@DAZZIBOX:/mnt/e/DeleteMe/1$ rm -v *
    rm: cannot remove ‘Acronis Disk Director 11 Home: Changing from Demo to Full Version | Knowledge Base.desktop’: No such file or directory
    rm: cannot remove ‘Acronis Disk Director 11 Home: Creating Acronis Bootable Media | Knowledge Base.desktop’: No such file or directory
    rm: cannot remove ‘Acronis Disk Director 11 Home: Creating WinPE-Based Acronis Bootable Media | Knowledge Base.desktop’: No such file or directory
    rm: cannot remove ‘Acronis Disk Director 11 Home: Installation of a Demo Version | Knowledge Base.desktop’: No such file or directory
    rm: cannot remove ‘How to Delete an MBR Partition From a Hard Drive | eHow.com.desktop’: No such file or directory
    Code:
    dazzi@DAZZIBOX:/mnt/e/DeleteMe/1$ cat -v
    (Cursor just blinked away for ages until I shut bash down and restarted)

    Code:
    dazzi@DAZZIBOX:/mnt/e/DeleteMe/1$ sudo rm "Acronis Disk Director 11 Home: Changing from Demo to Full Version | Knowledge Base.desktop"
    [sudo] password for dazzi:
    rm: cannot remove ‘Acronis Disk Director 11 Home: Changing from Demo to Full Version | Knowledge Base.desktop’: No such file or directory
    Code:
    dazzi@DAZZIBOX:/mnt/e/DeleteMe/1$ rm -rfv -- *
    dazzi@DAZZIBOX:/mnt/e/DeleteMe/1$ ls
    ls: cannot access Acronis Disk Director 11 Home: Changing from Demo to Full Version | Knowledge Base.desktop: No such file or directory
    ls: cannot access Acronis Disk Director 11 Home: Creating Acronis Bootable Media | Knowledge Base.desktop: No such file or directory
    ls: cannot access Acronis Disk Director 11 Home: Creating WinPE-Based Acronis Bootable Media | Knowledge Base.desktop: No such file or directory
    ls: cannot access Acronis Disk Director 11 Home: Installation of a Demo Version | Knowledge Base.desktop: No such file or directory
    ls: cannot access How to Delete an MBR Partition From a Hard Drive | eHow.com.desktop: No such file or directory
    Acronis Disk Director 11 Home: Changing from Demo to Full Version | Knowledge Base.desktop
    Acronis Disk Director 11 Home: Creating Acronis Bootable Media | Knowledge Base.desktop
    Acronis Disk Director 11 Home: Creating WinPE-Based Acronis Bootable Media | Knowledge Base.desktop
    Acronis Disk Director 11 Home: Installation of a Demo Version | Knowledge Base.desktop
    How to Delete an MBR Partition From a Hard Drive | eHow.com.desktop
    (I got no error from the rm command so hoped it had done the job. The ls proved it hadn't.

    Code:
    dazzi@DAZZIBOX:/mnt/e/DeleteMe/1$ rm -i -- *
    rm: cannot remove ‘Acronis Disk Director 11 Home: Changing from Demo to Full Version | Knowledge Base.desktop’: No such file or directory
    rm: cannot remove ‘Acronis Disk Director 11 Home: Creating Acronis Bootable Media | Knowledge Base.desktop’: No such file or directory
    rm: cannot remove ‘Acronis Disk Director 11 Home: Creating WinPE-Based Acronis Bootable Media | Knowledge Base.desktop’: No such file or directory
    rm: cannot remove ‘Acronis Disk Director 11 Home: Installation of a Demo Version | Knowledge Base.desktop’: No such file or directory
    rm: cannot remove ‘How to Delete an MBR Partition From a Hard Drive | eHow.com.desktop’: No such file or directory
    Code:
    dazzi@DAZZIBOX:/mnt/e/DeleteMe/1$ rm "Acronis Disk Director 11 Home: Changing from Demo to Full Version \| Knowledge Base.desktop"
    rm: cannot remove ‘Acronis Disk Director 11 Home: Changing from Demo to Full Version \\| Knowledge Base.desktop’: No such file or directory

  2. #2
    Join Date
    Jul 2008
    Location
    The Left Coast of the USA
    Beans
    Hidden!
    Distro
    Kubuntu

    Re: Delete files with | in filename (using Win10 bash)

    Moved to Windows.

    The support areas of the forum are for request for support for the official flavors of Ubuntu.

    Cheers!
    Please read The Forum Rules and The Forum Posting Guidelines

    A thing discovered and kept to oneself must be discovered time and again by others. A thing discovered and shared with others need be discovered only the once.
    This universe is crazy. I'm going back to my own.

  3. #3
    Join Date
    Oct 2009
    Beans
    Hidden!
    Distro
    Ubuntu 22.04 Jammy Jellyfish

    Re: Delete files with | in filename (using Win10 bash)

    tab completion is probably going to be your friend.

    Code:
    rm -i A <TAB>
    Come to #ubuntuforums! We have cookies! | Basic Ubuntu Security Guide

    Tomorrow's an illusion and yesterday's a dream, today is a solution...

  4. #4
    Join Date
    Nov 2007
    Location
    London, England
    Beans
    7,703

    Re: Delete files with | in filename (using Win10 bash)

    I suspect that windows is the problem in that both '|' and ':' are illegal, so the file can't possibly exist.
    You might be able to boot a live Linux CD and use the file manager there to delete the files.

  5. #5
    Join Date
    Jan 2007
    Beans
    768
    Distro
    Ubuntu 18.04 Bionic Beaver

    Re: Delete files with | in filename (using Win10 bash)

    Can you delete them from Windows Explorer or the Windows command prompt?
    Current 'buntu systems: multiple systems running Server or Desktop 22.04 LTS / Retired or Upgraded: 18.04.2 LTS, Mythbuntu 16.04 LTS, Ubuntu 16.04.1 LTS, 14.04 LTS, 10.04 LTS, 8.04 LTS
    Been using ubuntu since 6.04 (16 years!)

  6. #6
    Join Date
    Oct 2009
    Beans
    Hidden!
    Distro
    Ubuntu 22.04 Jammy Jellyfish

    Re: Delete files with | in filename (using Win10 bash)

    Quote Originally Posted by The Cog View Post
    I suspect that windows is the problem in that both '|' and ':' are illegal, so the file can't possibly exist.
    You might be able to boot a live Linux CD and use the file manager there to delete the files.
    Probably right about that.
    Come to #ubuntuforums! We have cookies! | Basic Ubuntu Security Guide

    Tomorrow's an illusion and yesterday's a dream, today is a solution...

  7. #7
    Join Date
    Jan 2007
    Beans
    768
    Distro
    Ubuntu 18.04 Bionic Beaver

    Re: Delete files with | in filename (using Win10 bash)

    Another thing to try is renaming the files in Windows Explorer to valid names and then try deleting them.

    If that doesn't work, boot a Linux live CD, mount the disk and try deleting them from there.
    Current 'buntu systems: multiple systems running Server or Desktop 22.04 LTS / Retired or Upgraded: 18.04.2 LTS, Mythbuntu 16.04 LTS, Ubuntu 16.04.1 LTS, 14.04 LTS, 10.04 LTS, 8.04 LTS
    Been using ubuntu since 6.04 (16 years!)

  8. #8
    Join Date
    Oct 2009
    Beans
    6

    Re: Delete files with | in filename (using Win10 bash)

    Thank you everyone, renaming/deleting in Windows explorer didn't work, that was why I was trying bash

    Tab completion failed at the | - though not at the : which might be good news.

    I'll try a live CD and report back.

  9. #9
    Join Date
    Dec 2007
    Beans
    12,521

    Re: Delete files with | in filename (using Win10 bash)

    Would enclosing these filenames in single quotes help?

  10. #10
    Join Date
    Oct 2009
    Beans
    6

    Re: Delete files with | in filename (using Win10 bash)

    Quote Originally Posted by The Cog View Post
    I suspect that windows is the problem in that both '|' and ':' are illegal, so the file can't possibly exist.
    You might be able to boot a live Linux CD and use the file manager there to delete the files.
    The live cD did the job. Deleted the folders and emptied trash using the Ubuntu gui with no fuss at all.

    thank you for everyone's advice

Tags for this Thread

Bookmarks

Posting Permissions

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