Results 1 to 4 of 4

Thread: How to remove a double named file

  1. #1

    Default How to remove a double named file

    Hey All,
    Tried the advanced search but to no luck,
    My question is using rm or some such command how do I remove a double file like " New File" look through everything I own no explantion.
    Thanks in advance

    Graeme

  2. #2
    Join Date
    Aug 2010
    Location
    Chicago suburbs
    Posts
    15,674
    Blog Entries
    3

    Default Re: How to remove a double named file

    The question isn't completely clear.
    Code:
    # if the file is named " New File" (without the quotes) use:
    rm " New File"
    # if the file is named " New File" (with the quotes) use:
    rm '" New File"'
    # I also tested the following, but it didn't work:
    rm "\" New File\""
    # if the file is named '" New File"' (with both sets of quotes), use (I didn't test this):
    rm "'"'" New File"'"'"
    # You can probably also do it with:
    rm *New?File*
    # though there is a risk that might match more than one file name.
    I hope that helps.
    openSUSE Leap 15.3; KDE Plasma 5.18.6;

  3. #3

    Default Re: How to remove a double named file

    Hey nrickert,
    Thanks it helped and sorry I sould have explained better!
    What had happened someone had created a new file in a samba shared folder called New file.
    So used the rm New?file command that worked
    but rm New file wont I get a error saying no such file or directory

    Regards
    Graeme

  4. #4
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,683
    Blog Entries
    4

    Default Re: How to remove a double named file

    Either of these will work:

    rm New\ file
    rm 'New file'

    Reason is the shell uses whitespace as argument separators. Whitespace is acceptable in Linux filenames, but you have to get the whitespace past the command line shell. Of course you can also remove it in a folder browser program.

Posting Permissions

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