Friday, May 3, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 2882  / 3 Years ago, fri, october 1, 2021, 5:15:21

A script I wrote named a file "() - ." according to Filezilla. Filezilla was unable to delete it from the server so I tried to "rm "() - ." from inside the containing folder and received "rm: cannot remove `() - .': No such file or directory". I then used "ls" which shows...



 () -  .                                               03_The_Kill_30_Seconds_to_Mars.mp3                 Crooked X (Crooked X) - 08 Nightmare.mp3
01 Attack - 30 Seconds to Mars.mp3 03 Wave of Mutilation - Pixies.mp3 Danzig (Danzig) - 01 Twist Of Cain.mp3


It lists the file in question though here it looks like it might contain a leading space and mabey two spaces between the "-" and the ".". So I tried to "rm" many combinations of spaces mixed between the other characters with no success.



I also tried renaming it but with the same error.



My fallback is to replace it with a 0KB file of the same name but, I'd rather delete it, (read- I'm OCD and it's irritating me that it shows up in "ls")



Thanks for any help.



Running: Ubuntu 12.04 LTS Server Edition


More From » 12.04

 Answers
1

From the terminal... First, let's test before trying. Create a similar file with this command:



touch ()


Then to remove that file:



rm ()


The symbol is used for special characters.



In your case, as long as the file is the only file that starts with (), you should use this command



rm -i ()*


The -i makes it interactive (asks your permission).


[#33890] Saturday, October 2, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
musining

Total Points: 171
Total Questions: 124
Total Answers: 121

Location: Zambia
Member since Thu, Jun 25, 2020
4 Years ago
;