Re: rm command problem
Jonathan Arnold wrote: DAve wrote: director# find . -inum 107763 -exec rm -i {} \; remove ./.rhosts? y Well, that was fun! I was wondering just how many different ways people could come up with deleting the file, but this one has to be crowned the winner of the all important Most Obscure Solution :-) To delete something based upon the inode - fantastic! Most handy for filenames loaded with unprintable characters which ls just shows as ? and which you have no clue how to type or wildcard, but not required for simple - prefixed files, as has been demonstrated :-) --Alex ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
rm command problem
Hi, Accidentally I've created a file called -exclude and now I cann't delete it. I tried with: rm -exclude and rm *exclude but it returns this: rm: illegal option -- - usage: rm [-f | -i] [-dIPRrvW] file ... unlink file How can I delete it? Thanks Efren Bravo. - Fight back spam! Download the Blue Frog. http://www.bluesecurity.com/register/s?user=ZWZyZW5iYQ%3D%3D __ LLama Gratis a cualquier PC del Mundo. Llamadas a fijos y móviles desde 1 céntimo por minuto. http://es.voice.yahoo.com ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: rm command problem
In response to Efren Bravo [EMAIL PROTECTED]: Hi, Accidentally I've created a file called -exclude and now I cann't delete it. I tried with: rm -exclude and rm *exclude but it returns this: rm: illegal option -- - usage: rm [-f | -i] [-dIPRrvW] file ... unlink file How can I delete it? rm \-exclude or rm '-exclude' -- Bill Moran Collaborative Fusion Inc. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: rm command problem
On Oct 20, 2006, at 9:21 AM, Efren Bravo wrote: Accidentally I've created a file called -exclude and now I cann't delete it. Try: rm -- -exclude -- -Chuck ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: rm command problem
In the last episode (Oct 20), Bill Moran said: In response to Efren Bravo [EMAIL PROTECTED]: Accidentally I've created a file called -exclude and now I cann't delete it. I tried with: rm -exclude and rm *exclude but it returns this: rm: illegal option -- - usage: rm [-f | -i] [-dIPRrvW] file ... unlink file How can I delete it? rm \-exclude or rm '-exclude' Actually neither of those will work :) If '-' was a wildcard character interpreted by the shell it would have, but rm is the problem here, not the shell. You need to either tell rm to ignore leading dashes as options (using the -- option): rm -- -exclude , or move the dash away from the beginning of the path: rm ./-exclude -- Dan Nelson [EMAIL PROTECTED] ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: rm command problem [SOLVED]
works with #rm -- -filename thanks again.. --- Bill Moran [EMAIL PROTECTED] escribió: In response to Efren Bravo [EMAIL PROTECTED]: Hi, Accidentally I've created a file called -exclude and now I cann't delete it. I tried with: rm -exclude and rm *exclude but it returns this: rm: illegal option -- - usage: rm [-f | -i] [-dIPRrvW] file ... unlink file How can I delete it? rm \-exclude or rm '-exclude' -- Bill Moran Collaborative Fusion Inc. __ LLama Gratis a cualquier PC del Mundo. Llamadas a fijos y móviles desde 1 céntimo por minuto. http://es.voice.yahoo.com ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: rm command problem
Bill Moran wrote: In response to Efren Bravo [EMAIL PROTECTED]: Hi, Accidentally I've created a file called -exclude and now I cann't delete it. I tried with: rm -exclude and rm *exclude but it returns this: rm: illegal option -- - usage: rm [-f | -i] [-dIPRrvW] file ... unlink file How can I delete it? rm \-exclude or rm '-exclude' Or even rm ./-exclude --Alex ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: rm command problem
Efren Bravo wrote: Hi, Accidentally I've created a file called -exclude and now I cann't delete it. I tried with: rm -exclude and rm *exclude but it returns this: rm: illegal option -- - usage: rm [-f | -i] [-dIPRrvW] file ... unlink file How can I delete it? You have probably found that anything you try errors because the shell thinks -e is a switch. The easiest way is to find the files inode number and delete the file using that. director# ls -i 107008 .bash_history107760 .login 107759 .mail_aliases 107764 .profile 107765 .shrc 107758 .cshrc 107761 .login_conf 107762 .mailrc 107763 .rhosts then use find to remove the file. director# find . -inum 107763 -exec rm -i {} \; remove ./.rhosts? y This works for all manner of funky file names. I had done that many times before, generally from not reading man pages and passing switches to programs that didn't expect it, or by piping commands incorrectly. DAve -- Three years now I've asked Google why they don't have a logo change for Memorial Day. Why do they choose to do logos for other non-international holidays, but nothing for Veterans? Maybe they forgot who made that choice possible. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: rm command problem
rm -- -exclude taken from man rm. Michael --- Efren Bravo [EMAIL PROTECTED] wrote: Hi, Accidentally I've created a file called -exclude and now I cann't delete it. I tried with: rm -exclude and rm *exclude but it returns this: rm: illegal option -- - usage: rm [-f | -i] [-dIPRrvW] file ... unlink file How can I delete it? Thanks Efren Bravo. - Fight back spam! Download the Blue Frog. http://www.bluesecurity.com/register/s?user=ZWZyZW5iYQ%3D%3D __ LLama Gratis a cualquier PC del Mundo. Llamadas a fijos y m�viles desde 1 c�ntimo por minuto. http://es.voice.yahoo.com ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED] ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: rm command problem
DAve wrote: Efren Bravo wrote: Hi, Accidentally I've created a file called -exclude and now I cann't delete it. I tried with: rm -exclude and rm *exclude but it returns this: rm: illegal option -- - usage: rm [-f | -i] [-dIPRrvW] file ... unlink file How can I delete it? You have probably found that anything you try errors because the shell thinks -e is a switch. The easiest way is to find the files inode number and delete the file using that. director# ls -i 107008 .bash_history107760 .login 107759 .mail_aliases 107764 .profile 107765 .shrc 107758 .cshrc 107761 .login_conf 107762 .mailrc 107763 .rhosts then use find to remove the file. director# find . -inum 107763 -exec rm -i {} \; remove ./.rhosts? y Well, that was fun! I was wondering just how many different ways people could come up with deleting the file, but this one has to be crowned the winner of the all important Most Obscure Solution :-) To delete something based upon the inode - fantastic! -- Jonathan Arnold (mailto:[EMAIL PROTECTED]) Daemon Dancing in the Dark, a FreeBSD weblog: http://freebsd.amazingdev.com/blog/ UNIX is user-friendly. It's just a bit picky about who its friends are. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: rm command problem
DAve wrote: Efren Bravo wrote: Hi, Accidentally I've created a file called -exclude and now I cann't delete it. I tried with: rm -exclude and rm *exclude but it returns this: rm: illegal option -- - usage: rm [-f | -i] [-dIPRrvW] file ... unlink file How can I delete it? You have probably found that anything you try errors because the shell thinks -e is a switch. The easiest way is to find the files inode number and delete the file using that. director# ls -i 107008 .bash_history107760 .login 107759 .mail_aliases 107764 .profile 107765 .shrc 107758 .cshrc 107761 .login_conf 107762 .mailrc 107763 .rhosts then use find to remove the file. director# find . -inum 107763 -exec rm -i {} \; remove ./.rhosts? y This works for all manner of funky file names. I had done that many times before, generally from not reading man pages and passing switches to programs that didn't expect it, or by piping commands incorrectly. DAve Chuck Swiger wrote: On Oct 20, 2006, at 9:21 AM, Efren Bravo wrote: Accidentally I've created a file called -exclude and now I cann't delete it. Try: rm -- -exclude See, just like I said. I got into trouble a long time ago by not reading man pages, and discovered I could delete by inode. I've done it that way from habit since. *Had I read the man pages back then* I would have known about rm -- ;^) I read all manner of man pages, README, CHANGES, and INSTALL docs now before I do anything new. John Polstra from SeaBug gently chided me into that habit until I caught on. DAve -- Three years now I've asked Google why they don't have a logo change for Memorial Day. Why do they choose to do logos for other non-international holidays, but nothing for Veterans? Maybe they forgot who made that choice possible. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]