Removing a file whose name starts with '-', was Re: How to command line rotate an image?
Kevin Fries
kfries6 at gmail.com
Fri Nov 12 13:39:41 MST 2010
Put the filename in single (not double) quotes.
Kevin Fries
On Nov 12, 2010 8:26 AM, "Mike Ballon" <mike.ballon at gmail.com> wrote:
OK, this is the last time I answer from the bar :)
I didn't mean that using inodes was the "only" way, I just knew it would
work.
I also stated that the syntax might not be correct as I didn't test it.
[name at hostd1 ~]$ ls -li
total 64
31758 -rw-rw-r-- 1 user group 4549 Oct 21 14:50 text.html
[name at hostd1 ~]$ find . -inum 31758 -exec rm -i {} \;
rm: remove regular file `./text.html'? y
You could also use find . -inum 31758 | xargs rm
I think CLI users should be aware of multiple options so thanks to those
that replied with how to escape the special characters.
-Mike
On Fri, Nov 12, 2010 at 9:42 AM, Dale Farnsworth <dale at farnsworth.org>
wrote:
> > > > I don't know who to rotate the image, but to delete your file you
> need > > to use the inode. T...
> ---------------------------------------------------
> PLUG-discuss mailing list - PLUG-discuss at lists.plug.phoenix.az.us
> To subscribe, unsubscribe, or to change your mail settings:
> http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss
>
---------------------------------------------------
PLUG-discuss mailing list - PLUG-discuss at lists.plug.phoenix.az.us
To subscribe, unsubscribe, or to change your mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.PLUG.phoenix.az.us/pipermail/plug-discuss/attachments/20101112/3347b9a7/attachment.html>
More information about the PLUG-discuss
mailing list