Remove a file called -r using rm


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Remove a file called -r using rm
# 1  
Old 05-18-2007
Remove a file called -r using rm

Is there any way to remove a file named "-r" using "rm", because "rm" assumes that file is one of it's options if I type "rm -r" and then throws an error message?
I also tried "rm -r -r" and that didn't work either.
# 2  
Old 05-18-2007
rm ./-r ***
# 3  
Old 05-18-2007
Thanks very much, that's fixed it.
# 4  
Old 05-18-2007
Also -- can be used,
Code:
 rm -- -r

Thanks
Nagarajan Ganesan.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell script to pass the config file lines as variable on the respective called function on a script

I want to make a config file which contain all the paths. i want to read the config file line by line and pass as an argument on my below function. Replace all the path with reading config path line by line and pass in respective functions. how can i achieve that? Kindly guide. ... (6 Replies)
Discussion started by: sadique.manzar
6 Replies

2. Shell Programming and Scripting

Exclude certain file names while selectingData files coming in different names in a file name called

Data files coming in different names in a file name called process.txt. 1. shipments_yyyymmdd.gz 2 Order_yyyymmdd.gz 3. Invoice_yyyymmdd.gz 4. globalorder_yyyymmdd.gz The process needs to discard all the below files and only process two of the 4 file names available ... (1 Reply)
Discussion started by: dsravanam
1 Replies

3. Shell Programming and Scripting

Need output of script on screen and file with correct return status of the called script.

Hi, I am trying to capture logs of the script in the file as well as on the screen. I have used exec and tee command for this. While using exec command I am getting the correct output in the file but, script output is not getting displayed on the screen as it get executed. Below is my sample... (14 Replies)
Discussion started by: Prathmesh
14 Replies

4. Shell Programming and Scripting

Remove file called "-X"??

Hi all, So I have found a file literally called "-X" in a folder, that is preventing me from using any meaningful commands in that folder because, as I understand it, at command runtime it will convert any wildcard characters into matching filenames, thus a command such as: ls *Ends up actually... (7 Replies)
Discussion started by: dan-e
7 Replies

5. UNIX for Advanced & Expert Users

Rename file called "-X"??

Hi all, So I have found a file literally called "-X" in a folder, that is preventing me from using any meaningful commands in that folder because, as I understand it, at command runtime it will convert any wildcard characters into matching filenames, thus a command such as: ls *Ends up... (1 Reply)
Discussion started by: dan-e
1 Replies

6. UNIX for Dummies Questions & Answers

create a file called -a

Can I create a file called '-a' in unix.Or can i open it with vi ? vi \-a will give u an error that -a is invalid option for vi. (2 Replies)
Discussion started by: Swayam
2 Replies

7. Shell Programming and Scripting

how to split this file into blocks and then send these blocks as input to the tool called Yices?

Hello, I have a file like this: FILE.TXT: (define argc :: int) (assert ( > argc 1)) (assert ( = argc 1)) <check> # (define c :: float) (assert ( > c 0)) (assert ( = c 0)) <check> # now, i want to separate each block('#' is the delimeter), make them separate files, and then send them as... (5 Replies)
Discussion started by: paramad
5 Replies

8. Shell Programming and Scripting

Identify env file called

Hi, please help me.. in how to find out which env file is being called upon when an os user logs. when i su - oracle , i would like to know which env is called, because i see many env files under the home dir.. thanks, (2 Replies)
Discussion started by: jjoy
2 Replies

9. Shell Programming and Scripting

what is it called?

Hey, I've come across and have used things like: fase1=${QUERY_STRING%%&*} and I was wondering what this kind of actions is called? (I'm talking about the % and # operators on strings) Does anyone know where i can find more info about it? It looks like a very powerful tool... Regards, Karel (1 Reply)
Discussion started by: KarelVH
1 Replies

10. UNIX for Advanced & Expert Users

How to remove a directory called "--"

I need to remove a directory called "--"". But it seems "--" linked to /export/home/usr1, which I do not want to delete. How to rm "--" safely? The OS is Solaris 9. Thanks. (6 Replies)
Discussion started by: fld2007
6 Replies
Login or Register to Ask a Question