Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

rm issue 2

Status
Not open for further replies.

gatetec

MIS
Mar 22, 2007
420
US
How do you remove this particular file?

-rw-r--r-- 1 root d_sys 3715703 Jan 13 08:21 -k3,3
 
Sorry I take that back.

I tried it and got message not a recognised option k
 
You might also want to try
Code:
rm -- -k3,3
man rm said:
Note: The rm command supports the -- (dash, dash) parameter as a delimiter
that indicates the end of the flags.

On the internet no one knows you're a dog

Columb Healy
 
You could always try,
touch temp1
rm temp1 -k3,3
 
columb's -- solution works, I just created a file named "-k3,3" and deleted it. The -- marker is exactly what popped into mind.
 
Another way to do this is to use the "-i" option with rm.

rm -i *

you will be prompted to delete each individual file. Say no to all except the file you actually want to delete.
 
Agreed, spamly, but not too friendly if there are hundreds/thousands of files, as well as introducing a greater possibility of answering y to the wrong file.

I want to be good, is that not enough?
 
I've never seen Columb or andy61's methods. That's one of the reasons why I love checking into to this site regularly. I learn more "tricks"!
 
Thanks guys for your help! That works on my own personal AIX shell. I'm still scared to use it on the system at work though. Maybe I will.
 
fine.

you can also delete it in the following way:

$ touch ./-k3,3
$ ll
total 0
-rw-r--r--- 1 test4 staff 0 Jan 23 12:03 -k3,3
$ rm -i ./-k3,3
rm: Remove ./-k3,3? y
$ ls
$




$ touch "\-k3,3"
$ ls
\-k3,3
$ ll
total 0
-rw-r--r--- 1 test4 staff 0 Jan 23 12:04 \-k3,3
$ rm -i ./\\-k3,3
rm: Remove ./\-k3,3? y
$ ll
total 0
$

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top