Krishna Logo
qa training in canada now
Divied
Call: Anusha @ 1 (877) 864-8462

 

Latest News
Home Navigation Divied
INTERVIEW Navigation Divied UNIX INTERVIEW QUESTIONS Navigation Divied How do I remove a file that begins with a hyphen?
How Do I Remove A File That Begins With A Hyphen?
How do I remove a file that begins with a hyphen?

 

How do I remove a file that begins with a hyphen?
Ans: rm will normally complain about an invalid option if you say: rm -filename
Most UNIX commands will behave this way, treating the characters after the hyphen
as an option.
Rm has an option to say 'end of options, the next parameter is a filename'
The option is '--' (double hyphen)
So you can use: rm -- -filename
Most UNIX commands have a -- option like this to signify end of options.
 

Shadow Bottom
 
 
© 2005 -