Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!sdd.hp.com!spool.mu.edu!uunet!viusys!alembic!csu From: csu@alembic.acs.com (Dave Mack) Newsgroups: comp.unix.misc Subject: Re: Unix problem Message-ID: <1991Apr25.044544.27029@alembic.acs.com> Date: 25 Apr 91 04:45:44 GMT Article-I.D.: alembic.1991Apr25.044544.27029 References: <14425@medusa.cs.purdue.edu> <6238@beryl12.UUCP> Organization: Alembic Computer Services, McLean VA Lines: 27 In article <6238@beryl12.UUCP> mostek@motcid.UUCP (Frank B. Mostek) writes: >wangjw@cs.purdue.EDU (Jingwen Wang) writes: > >> I was using the X-window and somehow generated some garbage files. I >>cannot remove some files because these files are named "-C", "-f" etc. >>Can someone tell me how to remove these garbages? > >Use the find command: > >find . -name "-C" -exec rm -f {} \; Many versions of rm(1) support the "-" flag, as in "rm - -C" which tells rm that the next argument is not an option even if it starts with a dash. Check your local man page. >I am not sure why this works and >rm -f "-C" does not work. Because the shell removes the quotes before execing rm. It works in find because find interprets the argument after -name as a filename even if it begins with a "-". -- Dave Mack