Delete file with broken name
Clash 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
linux rm
add a comment |Â
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
linux rm
Related: unix.stackexchange.com/q/28983/117549
â Jeff Schaller
Nov 17 '17 at 20:11
add a comment |Â
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
linux rm
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
linux rm
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
add a comment |Â
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
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
3
down vote
accepted
Two suggestions:
Run
ls -li
to get the inode, then usefind
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.
- 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.
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
add a comment |Â
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.
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
add a comment |Â
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:
Run
ls -li
to get the inode, then usefind
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.
- 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.
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
add a comment |Â
up vote
3
down vote
accepted
Two suggestions:
Run
ls -li
to get the inode, then usefind
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.
- 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.
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
add a comment |Â
up vote
3
down vote
accepted
up vote
3
down vote
accepted
Two suggestions:
Run
ls -li
to get the inode, then usefind
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.
- 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.
Two suggestions:
Run
ls -li
to get the inode, then usefind
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.
- 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.
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
add a comment |Â
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
add a comment |Â
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.
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
add a comment |Â
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.
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
add a comment |Â
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.
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.
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
add a comment |Â
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
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Related: unix.stackexchange.com/q/28983/117549
â Jeff Schaller
Nov 17 '17 at 20:11