Re: deleting file '--preserve-permissions'



On Sat, Mar 31, 2007 at 10:36:03PM +0300, lalev@xxxxxxxxxxxxxxx wrote:
I've made mistake with tar. Something like

tar cvfz --preserve-permissions home.tgz *

or

tar cvfz --preserve-permissions * home.tgz

As result I have a file with name '--preserve-permissions'.
It seems that it's not easy to delete this file.

rm '--preserve-permissions'

does not give the desired result.
What should I do :-)

You should read the rm(1) man-page.
Especially the part that says:


NOTE
The rm command uses getopt(3) to parse its arguments, which allows it to
accept the --' option which will cause it to stop processing flag
options at that point. This will allow the removal of file names that
begin with a dash (-'). For example:
rm -- -filename
The same behavior can be obtained by using an absolute or relative path
reference. For example:
rm /home/user/-filename
rm ./-filename




--
<Insert your favourite quote here.>
Erik Trulsson
ertr1013@xxxxxxxxxxxxx
_______________________________________________
freebsd-questions@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Determine path of file
    ... I reference a file from a script through command line parameters. ... The file can be refered to as both absolute and relative path. ... I tried with addition of $pwd, but in case of an absolute reference I ...
    (comp.unix.shell)
  • Re: Determine path of file
    ... script.sh [referenced file] ... The file can be refered to as both absolute and relative path. ... I tried with addition of $pwd, but in case of an absolute reference I ...
    (comp.unix.shell)
  • Re: how to avoid broken references when give out projects
    ... "Tanja Krammer" schrieb ... is it possible to add reference with a relative path instead of ...
    (microsoft.public.dotnet.languages.vb)
  • Re: how to avoid broken references when give out projects
    ... Tanja Krammer wrote: ... is it possible to add reference with a relative path instead of absolute? ...
    (microsoft.public.dotnet.languages.vb)
  • Re: The Real TWINS Paradox - the Simplest Version
    ... then A's AVERAGE absolute velocity is also at least ... there is no absolute reference. ... According to the transorm these poles will be length contracted ... addition to the contraction of the poles, ...
    (sci.physics.relativity)