Saturday, May 18, 2024
 Popular · Latest · Hot · Upcoming
3
rated 0 times [  3] [ 0]  / answers: 1 / hits: 10491  / 1 Year ago, wed, december 7, 2022, 7:07:59

Can't delete a file with a '?' in the file name, it fails to delete with the message 'the file does not exist'.



I've tried through the terminal using



rm -f ./pathtofile?.mkv


But despite no failure message the file still exists. Any suggestions?


More From » delete

 Answers
3

The ? is most likely another non-ASCII symbol that your terminal program is unable to display so it displays ?. This is easily proven - you can execute touch ?.mkv and rm ?.mkv - both command execute just fine.



Files like that are easily deleted using a GUI file manager.



Alternatively you could try using wildcards. If command:



ls pathtofileFewLetters*.mkv


lists a single file you can safely run:



rm pathtofileFewLetters*.mkv`.


Finally you could try the harder but surer way as described in Can not delete files containing special characters in the file name as pointed by Android Dev above.


[#16229] Friday, December 9, 2022, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
tionpromoti

Total Points: 14
Total Questions: 112
Total Answers: 113

Location: Tonga
Member since Tue, Nov 30, 2021
3 Years ago
;