Quantcast
Viewing all articles
Browse latest Browse all 10

rm + how to remove file with special Characters

Image may be NSFW.
Clik here to view.
Question

I have this file in my linux machine:

 ----------9976723563nneh4_-----192.9.200.4

I try to delete this file but I cant as all see here:

what need to add to rm in order to remove this file ?

rm "----------9976723563nneh4_-----192.9.200.4"
rm: illegal option -- --------9976723563nneh4_-----192.9.200.4
usage: rm [-fiRr] file ...

.

rm '----------9976723563nneh4_-----192.9.200.4'
rm: illegal option -- --------9976723563nneh4_-----192.9.200.4
usage: rm [-fiRr] file ...
Asked by yael

Image may be NSFW.
Clik here to view.
Answer

rm -- ----------9976723563nneh4_-----192.9.200.4

You need -- in order to tell rm (and more or less all other GNU software) that all following parameters are file names even when beginning with “-”. Otherwise (and in your case) the file name is confused with options. Another possibility is

rm ./----------9976723563nneh4_-----192.9.200.4
Answered by Hauke Laging

Viewing all articles
Browse latest Browse all 10

Trending Articles