Click to See Complete Forum and Search --> : Neat Challange with Wildcards
Trogdor
11-03-2003, 10:31 PM
Here are the steps to the challange:
1) su to root
2) cd to /
3) open up vi, type "foo", and save the file as '*'
4) remove * without removing your entire filesystem!
Have fun!
bwkaz
11-03-2003, 10:46 PM
I can't get vim to do that. It keeps saying "E77: Too many filenames". But I can save the file to \*, so I did that instead. ls showed it as having the name * when I was done.
Then:
rm \*
removed the file nicely.
Besides, rm won't recurse into subdirectories anyway. So you could rm * anyway, unless you have real files in /, which is not a great idea...
0x12d3
11-03-2003, 11:46 PM
Originally posted by bwkaz
I can't get vim to do that. It keeps saying "E77: Too many filenames". But I can save the file to \*, so I did that instead. ls showed it as having the name * when I was done.
Then:
rm \*
removed the file nicely.
Besides, rm won't recurse into subdirectories anyway. So you could rm * anyway, unless you have real files in /, which is not a great idea...
Umm.. yeah. Me too
: )
l01yuk
11-04-2003, 09:41 AM
In vim
:w \*
Satanic Atheist
11-04-2003, 01:21 PM
1) Use the escape character "\" to delete it.
2) Use Midnight Commander to get rid of it.
3) Use Konqueror to scrap it.
James
bwkaz
11-04-2003, 08:17 PM
Or, now that I think about it more,:
4) surround the * with single quotes to get rid of only the file
(single quotes prevent bash from doing pathname expansion.)