Delete file with broken name

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
2
down vote

favorite












I've somehow created a file that I can not seem to figure out how to delete via CLI.



$ ls -alF
total 8195
-rw-r--r--+ 1 me my_group 0 Jul 19 14:10 ''$'r'
drwxrwx---+ 1 system system 0 Nov 17 14:58 ./
drwxr-xr-x+ 1 system system 0 Jul 17 15:40 ../
...


The first line item here I can not seem to find the correct escape sequence to be able to delete.



Attempting to grep this entry does not even work properly:



$ ls -alF | head -n2
total 8195
-rw-r--r--+ 1 me my_group 0 Jul 19 14:10


Note that when grepping / using other pipe'd commands, I can never see the name of the file.



this is a Cygwin wrapped Win10 environment







share|improve this question






















  • Related: unix.stackexchange.com/q/28983/117549
    – Jeff Schaller
    Nov 17 '17 at 20:11














up vote
2
down vote

favorite












I've somehow created a file that I can not seem to figure out how to delete via CLI.



$ ls -alF
total 8195
-rw-r--r--+ 1 me my_group 0 Jul 19 14:10 ''$'r'
drwxrwx---+ 1 system system 0 Nov 17 14:58 ./
drwxr-xr-x+ 1 system system 0 Jul 17 15:40 ../
...


The first line item here I can not seem to find the correct escape sequence to be able to delete.



Attempting to grep this entry does not even work properly:



$ ls -alF | head -n2
total 8195
-rw-r--r--+ 1 me my_group 0 Jul 19 14:10


Note that when grepping / using other pipe'd commands, I can never see the name of the file.



this is a Cygwin wrapped Win10 environment







share|improve this question






















  • Related: unix.stackexchange.com/q/28983/117549
    – Jeff Schaller
    Nov 17 '17 at 20:11












up vote
2
down vote

favorite









up vote
2
down vote

favorite











I've somehow created a file that I can not seem to figure out how to delete via CLI.



$ ls -alF
total 8195
-rw-r--r--+ 1 me my_group 0 Jul 19 14:10 ''$'r'
drwxrwx---+ 1 system system 0 Nov 17 14:58 ./
drwxr-xr-x+ 1 system system 0 Jul 17 15:40 ../
...


The first line item here I can not seem to find the correct escape sequence to be able to delete.



Attempting to grep this entry does not even work properly:



$ ls -alF | head -n2
total 8195
-rw-r--r--+ 1 me my_group 0 Jul 19 14:10


Note that when grepping / using other pipe'd commands, I can never see the name of the file.



this is a Cygwin wrapped Win10 environment







share|improve this question














I've somehow created a file that I can not seem to figure out how to delete via CLI.



$ ls -alF
total 8195
-rw-r--r--+ 1 me my_group 0 Jul 19 14:10 ''$'r'
drwxrwx---+ 1 system system 0 Nov 17 14:58 ./
drwxr-xr-x+ 1 system system 0 Jul 17 15:40 ../
...


The first line item here I can not seem to find the correct escape sequence to be able to delete.



Attempting to grep this entry does not even work properly:



$ ls -alF | head -n2
total 8195
-rw-r--r--+ 1 me my_group 0 Jul 19 14:10


Note that when grepping / using other pipe'd commands, I can never see the name of the file.



this is a Cygwin wrapped Win10 environment









share|improve this question













share|improve this question




share|improve this question








edited Nov 17 '17 at 20:10

























asked Nov 17 '17 at 20:05









Matt Clark

204211




204211











  • Related: unix.stackexchange.com/q/28983/117549
    – Jeff Schaller
    Nov 17 '17 at 20:11
















  • Related: unix.stackexchange.com/q/28983/117549
    – Jeff Schaller
    Nov 17 '17 at 20:11















Related: unix.stackexchange.com/q/28983/117549
– Jeff Schaller
Nov 17 '17 at 20:11




Related: unix.stackexchange.com/q/28983/117549
– Jeff Schaller
Nov 17 '17 at 20:11










2 Answers
2






active

oldest

votes

















up vote
3
down vote



accepted










Two suggestions:




  1. Run ls -li to get the inode, then use find to delete it.



    ls -li foo
    42 -rw-r--r--. 1 user group 0 Nov 17 15:07 foo


If the inode was 42, as in the above example, run: find . -inum 42 -exec rm -i ;, which will interactively prompt you to remove the file.



  1. Run rm -i ? ?? ??? to have the shell expand to the one, two, and three-character filenames in the current directory; one of them will appear to be blank, and is probably the file in question; simply answer "no" to the prompts to remove the files you want to keep.





share|improve this answer




















  • I've used linux for years.. Never knew you could print inode info with ls, and also did not know that bash expands ?'s. Perfect answer, both solutions worked as expected.
    – Matt Clark
    Nov 17 '17 at 20:17










  • the 1st one looks more reliable
    – RomanPerekhrest
    Nov 17 '17 at 20:28

















up vote
0
down vote













I tried creating a file with the same name as yours and I was able to delete it with rm every time. Do you know which version of rm you have installed? Perhaps the version you have is buggy? I assume you tried simply putting the name inside double quotes. If not, give that a try.



In the case that dosen't work, I'd suggest you try using rm with some wildcards. Move all other files out of the folder and just run the following.



rm -f "*"



That only failed me once, when the file filesystem itself was corrupt, and fsck didn't touch it. I honestly just left the file there until the next time I reformatted it.






share|improve this answer






















  • Again, this is a Win10 env wrapped in Cygwin, so there could be differences there. rm (GNU coreutils) 8.26 || Packaged by Cygwin (8.26-2)
    – Matt Clark
    Nov 17 '17 at 20:38










  • Interesting that Cygwin actually has a newer version of coreutils then I do. Have you tried deleting the file using only escape sequences? Like, rm $(echo -e "<escape sequences here>"). Perhaps specifying each character by code would work.
    – TheNH813
    Nov 17 '17 at 20:43











Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f405333%2fdelete-file-with-broken-name%23new-answer', 'question_page');

);

Post as a guest






























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
3
down vote



accepted










Two suggestions:




  1. Run ls -li to get the inode, then use find to delete it.



    ls -li foo
    42 -rw-r--r--. 1 user group 0 Nov 17 15:07 foo


If the inode was 42, as in the above example, run: find . -inum 42 -exec rm -i ;, which will interactively prompt you to remove the file.



  1. Run rm -i ? ?? ??? to have the shell expand to the one, two, and three-character filenames in the current directory; one of them will appear to be blank, and is probably the file in question; simply answer "no" to the prompts to remove the files you want to keep.





share|improve this answer




















  • I've used linux for years.. Never knew you could print inode info with ls, and also did not know that bash expands ?'s. Perfect answer, both solutions worked as expected.
    – Matt Clark
    Nov 17 '17 at 20:17










  • the 1st one looks more reliable
    – RomanPerekhrest
    Nov 17 '17 at 20:28














up vote
3
down vote



accepted










Two suggestions:




  1. Run ls -li to get the inode, then use find to delete it.



    ls -li foo
    42 -rw-r--r--. 1 user group 0 Nov 17 15:07 foo


If the inode was 42, as in the above example, run: find . -inum 42 -exec rm -i ;, which will interactively prompt you to remove the file.



  1. Run rm -i ? ?? ??? to have the shell expand to the one, two, and three-character filenames in the current directory; one of them will appear to be blank, and is probably the file in question; simply answer "no" to the prompts to remove the files you want to keep.





share|improve this answer




















  • I've used linux for years.. Never knew you could print inode info with ls, and also did not know that bash expands ?'s. Perfect answer, both solutions worked as expected.
    – Matt Clark
    Nov 17 '17 at 20:17










  • the 1st one looks more reliable
    – RomanPerekhrest
    Nov 17 '17 at 20:28












up vote
3
down vote



accepted







up vote
3
down vote



accepted






Two suggestions:




  1. Run ls -li to get the inode, then use find to delete it.



    ls -li foo
    42 -rw-r--r--. 1 user group 0 Nov 17 15:07 foo


If the inode was 42, as in the above example, run: find . -inum 42 -exec rm -i ;, which will interactively prompt you to remove the file.



  1. Run rm -i ? ?? ??? to have the shell expand to the one, two, and three-character filenames in the current directory; one of them will appear to be blank, and is probably the file in question; simply answer "no" to the prompts to remove the files you want to keep.





share|improve this answer












Two suggestions:




  1. Run ls -li to get the inode, then use find to delete it.



    ls -li foo
    42 -rw-r--r--. 1 user group 0 Nov 17 15:07 foo


If the inode was 42, as in the above example, run: find . -inum 42 -exec rm -i ;, which will interactively prompt you to remove the file.



  1. Run rm -i ? ?? ??? to have the shell expand to the one, two, and three-character filenames in the current directory; one of them will appear to be blank, and is probably the file in question; simply answer "no" to the prompts to remove the files you want to keep.






share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 17 '17 at 20:10









Jeff Schaller

32.1k849109




32.1k849109











  • I've used linux for years.. Never knew you could print inode info with ls, and also did not know that bash expands ?'s. Perfect answer, both solutions worked as expected.
    – Matt Clark
    Nov 17 '17 at 20:17










  • the 1st one looks more reliable
    – RomanPerekhrest
    Nov 17 '17 at 20:28
















  • I've used linux for years.. Never knew you could print inode info with ls, and also did not know that bash expands ?'s. Perfect answer, both solutions worked as expected.
    – Matt Clark
    Nov 17 '17 at 20:17










  • the 1st one looks more reliable
    – RomanPerekhrest
    Nov 17 '17 at 20:28















I've used linux for years.. Never knew you could print inode info with ls, and also did not know that bash expands ?'s. Perfect answer, both solutions worked as expected.
– Matt Clark
Nov 17 '17 at 20:17




I've used linux for years.. Never knew you could print inode info with ls, and also did not know that bash expands ?'s. Perfect answer, both solutions worked as expected.
– Matt Clark
Nov 17 '17 at 20:17












the 1st one looks more reliable
– RomanPerekhrest
Nov 17 '17 at 20:28




the 1st one looks more reliable
– RomanPerekhrest
Nov 17 '17 at 20:28












up vote
0
down vote













I tried creating a file with the same name as yours and I was able to delete it with rm every time. Do you know which version of rm you have installed? Perhaps the version you have is buggy? I assume you tried simply putting the name inside double quotes. If not, give that a try.



In the case that dosen't work, I'd suggest you try using rm with some wildcards. Move all other files out of the folder and just run the following.



rm -f "*"



That only failed me once, when the file filesystem itself was corrupt, and fsck didn't touch it. I honestly just left the file there until the next time I reformatted it.






share|improve this answer






















  • Again, this is a Win10 env wrapped in Cygwin, so there could be differences there. rm (GNU coreutils) 8.26 || Packaged by Cygwin (8.26-2)
    – Matt Clark
    Nov 17 '17 at 20:38










  • Interesting that Cygwin actually has a newer version of coreutils then I do. Have you tried deleting the file using only escape sequences? Like, rm $(echo -e "<escape sequences here>"). Perhaps specifying each character by code would work.
    – TheNH813
    Nov 17 '17 at 20:43















up vote
0
down vote













I tried creating a file with the same name as yours and I was able to delete it with rm every time. Do you know which version of rm you have installed? Perhaps the version you have is buggy? I assume you tried simply putting the name inside double quotes. If not, give that a try.



In the case that dosen't work, I'd suggest you try using rm with some wildcards. Move all other files out of the folder and just run the following.



rm -f "*"



That only failed me once, when the file filesystem itself was corrupt, and fsck didn't touch it. I honestly just left the file there until the next time I reformatted it.






share|improve this answer






















  • Again, this is a Win10 env wrapped in Cygwin, so there could be differences there. rm (GNU coreutils) 8.26 || Packaged by Cygwin (8.26-2)
    – Matt Clark
    Nov 17 '17 at 20:38










  • Interesting that Cygwin actually has a newer version of coreutils then I do. Have you tried deleting the file using only escape sequences? Like, rm $(echo -e "<escape sequences here>"). Perhaps specifying each character by code would work.
    – TheNH813
    Nov 17 '17 at 20:43













up vote
0
down vote










up vote
0
down vote









I tried creating a file with the same name as yours and I was able to delete it with rm every time. Do you know which version of rm you have installed? Perhaps the version you have is buggy? I assume you tried simply putting the name inside double quotes. If not, give that a try.



In the case that dosen't work, I'd suggest you try using rm with some wildcards. Move all other files out of the folder and just run the following.



rm -f "*"



That only failed me once, when the file filesystem itself was corrupt, and fsck didn't touch it. I honestly just left the file there until the next time I reformatted it.






share|improve this answer














I tried creating a file with the same name as yours and I was able to delete it with rm every time. Do you know which version of rm you have installed? Perhaps the version you have is buggy? I assume you tried simply putting the name inside double quotes. If not, give that a try.



In the case that dosen't work, I'd suggest you try using rm with some wildcards. Move all other files out of the folder and just run the following.



rm -f "*"



That only failed me once, when the file filesystem itself was corrupt, and fsck didn't touch it. I honestly just left the file there until the next time I reformatted it.







share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 17 '17 at 20:41

























answered Nov 17 '17 at 20:34









TheNH813

1196




1196











  • Again, this is a Win10 env wrapped in Cygwin, so there could be differences there. rm (GNU coreutils) 8.26 || Packaged by Cygwin (8.26-2)
    – Matt Clark
    Nov 17 '17 at 20:38










  • Interesting that Cygwin actually has a newer version of coreutils then I do. Have you tried deleting the file using only escape sequences? Like, rm $(echo -e "<escape sequences here>"). Perhaps specifying each character by code would work.
    – TheNH813
    Nov 17 '17 at 20:43

















  • Again, this is a Win10 env wrapped in Cygwin, so there could be differences there. rm (GNU coreutils) 8.26 || Packaged by Cygwin (8.26-2)
    – Matt Clark
    Nov 17 '17 at 20:38










  • Interesting that Cygwin actually has a newer version of coreutils then I do. Have you tried deleting the file using only escape sequences? Like, rm $(echo -e "<escape sequences here>"). Perhaps specifying each character by code would work.
    – TheNH813
    Nov 17 '17 at 20:43
















Again, this is a Win10 env wrapped in Cygwin, so there could be differences there. rm (GNU coreutils) 8.26 || Packaged by Cygwin (8.26-2)
– Matt Clark
Nov 17 '17 at 20:38




Again, this is a Win10 env wrapped in Cygwin, so there could be differences there. rm (GNU coreutils) 8.26 || Packaged by Cygwin (8.26-2)
– Matt Clark
Nov 17 '17 at 20:38












Interesting that Cygwin actually has a newer version of coreutils then I do. Have you tried deleting the file using only escape sequences? Like, rm $(echo -e "<escape sequences here>"). Perhaps specifying each character by code would work.
– TheNH813
Nov 17 '17 at 20:43





Interesting that Cygwin actually has a newer version of coreutils then I do. Have you tried deleting the file using only escape sequences? Like, rm $(echo -e "<escape sequences here>"). Perhaps specifying each character by code would work.
– TheNH813
Nov 17 '17 at 20:43


















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f405333%2fdelete-file-with-broken-name%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

How to check contact read email or not when send email to Individual?

Christian Cage

How to properly install USB display driver for Fresco Logic FL2000DX on Ubuntu?