How can I remove this file?
-rw-r--r-- 1 root root 28707 Mar 31 12:31 --backup=numbered
I've tried a few different methods, but most attempts interprets the file name as a switch (which it doesn't understand).
TIA,
Frank M. Ramaekers Jr. | Systems Programmer | Information Technology | American Income Life Insurance Company | 254-761-6649
On Wed, Apr 02, 2014 at 09:44:57AM -0500, Frank M. Ramaekers wrote:
How can I remove this file?
-rw-r--r-- 1 root root 28707 Mar 31 12:31 --backup=numbered
I've tried a few different methods, but most attempts interprets the file name as a switch (which it doesn't understand).
rm -- --backup=numbered
-- stops the processing of command line arguments so any file name after will be interpreted literally.
John
Ahhh...that's the ticket!
Frank M. Ramaekers Jr.
-----Original Message----- From: centos-bounces@centos.org [mailto:centos-bounces@centos.org] On Behalf Of John R. Dennison Sent: Wednesday, April 02, 2014 9:48 AM To: centos@centos.org Subject: Re: [CentOS] Removing a file that starts with dashes
On Wed, Apr 02, 2014 at 09:44:57AM -0500, Frank M. Ramaekers wrote:
How can I remove this file?
-rw-r--r-- 1 root root 28707 Mar 31 12:31 --backup=numbered
I've tried a few different methods, but most attempts interprets the file name as a switch (which it doesn't understand).
rm -- --backup=numbered
-- stops the processing of command line arguments so any file name
after will
be interpreted literally.
John
-- "Worry never robs tomorrow of its sorrow, it only saps today of its
joy."
~~ Leo Buscaglia
"Frank M. Ramaekers" FRamaekers@ailife.com a écrit :
How can I remove this file?
-rw-r--r-- 1 root root 28707 Mar 31 12:31 --backup=numbered
rm "--backup=numbered"
HTH, Laurent.
rm: unrecognized option `--backup=numbered' Try `rm ./'--backup=numbered'' to remove the file `--backup=numbered'. Try `rm --help' for more information.
Frank M. Ramaekers Jr.
-----Original Message----- From: centos-bounces@centos.org [mailto:centos-bounces@centos.org] On Behalf Of Laurent Wandrebeck Sent: Wednesday, April 02, 2014 9:48 AM To: CentOS mailing list Subject: Re: [CentOS] Removing a file that starts with dashes
"Frank M. Ramaekers" FRamaekers@ailife.com a écrit :
How can I remove this file?
-rw-r--r-- 1 root root 28707 Mar 31 12:31 --backup=numbered
rm "--backup=numbered"
HTH, Laurent. _______________________________________________ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
On Wed, Apr 02, 2014 at 09:51:41AM -0500, Frank M. Ramaekers wrote:
rm: unrecognized option `--backup=numbered' Try `rm ./'--backup=numbered'' to remove the file `--backup=numbered'. Try `rm --help' for more information.
This is one of the oldest of oldest of Unix FAQs
eg http://fisica.ehu.es/ref/unixfaq.html#2.1
On Wed, Apr 02, 2014 at 09:51:41AM -0500, Frank M. Ramaekers wrote:
rm: unrecognized option `--backup=numbered' Try `rm ./'--backup=numbered'' to remove the file `--backup=numbered'.
This is what's worked for me. I know the double dash is supposed to stop interpretation of arguments, but it hasn't worked for me.
On Wed, Apr 02, 2014 at 02:05:08PM -0700, benfell@parts-unknown.org wrote:
On Wed, Apr 02, 2014 at 09:51:41AM -0500, Frank M. Ramaekers wrote:
rm: unrecognized option `--backup=numbered' Try `rm ./'--backup=numbered'' to remove the file `--backup=numbered'.
This is what's worked for me. I know the double dash is supposed to stop interpretation of arguments, but it hasn't worked for me.
I do not post solutions unless they work:
tty3 jrd@frodo:/tmp/jrd$ ls -l total 0 -rw-rw-r--. 1 jrd jrd 0 Apr 2 16:14 --silly-file-name tty3 jrd@frodo:/tmp/jrd$ rm -- --silly-file-name rm: remove regular empty file `--silly-file-name'? y tty3 jrd@frodo:/tmp/jrd$ ls tty3 jrd@frodo:/tmp/jrd$
What shell are you using? Perhaps that is interfering.
John
On Wed, Apr 02, 2014 at 04:16:51PM -0500, John R. Dennison wrote:
What shell are you using? Perhaps that is interfering.
Ah. Good point. I've been using zsh for so long I forget it's even an issue. ;-)
On Wed, Apr 02, 2014 at 02:23:07PM -0700, benfell@parts-unknown.org wrote:
On Wed, Apr 02, 2014 at 04:16:51PM -0500, John R. Dennison wrote:
What shell are you using? Perhaps that is interfering.
Ah. Good point. I've been using zsh for so long I forget it's even an issue. ;-)
:)
John
"Frank M. Ramaekers" FRamaekers@ailife.com a écrit :
rm: unrecognized option `--backup=numbered' Try `rm ./'--backup=numbered'' to remove the file `--backup=numbered'. Try `rm --help' for more information.
Frank M. Ramaekers Jr.
Damn, tested it with a path/file before sending a mail, didn’t think it would break without…lesson learned :) Laurent
rm -f "--backup=numered"
Regards Roberto
-----Original Message----- From: centos-bounces@centos.org [mailto:centos-bounces@centos.org] On Behalf Of Frank M. Ramaekers Sent: miércoles, 02 de abril de 2014 11:45 To: centos@centos.org Subject: [CentOS] Removing a file that starts with dashes
How can I remove this file?
-rw-r--r-- 1 root root 28707 Mar 31 12:31 --backup=numbered
I've tried a few different methods, but most attempts interprets the file name as a switch (which it doesn't understand).
TIA,
Frank M. Ramaekers Jr. | Systems Programmer | Information Technology | American Income Life Insurance Company | 254-761-6649
_______________________________________________ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
It is possible.
Mask the - by putting a \ or / in front ot it.
Or try:
rm ./-filename
On Wed, Apr 2, 2014 at 9:44 AM, Frank M. Ramaekers FRamaekers@ailife.com wrote:
How can I remove this file?
-rw-r--r-- 1 root root 28707 Mar 31 12:31 --backup=numbered
I've tried a few different methods, but most attempts interprets the file name as a switch (which it doesn't understand).
TIA,
Frank M. Ramaekers Jr. | Systems Programmer | Information Technology | American Income Life Insurance Company | 254-761-6649
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Frank M. Ramaekers wrote:
How can I remove this file?
-rw-r--r-- 1 root root 28707 Mar 31 12:31 --backup=numbered
I've tried a few different methods, but most attempts interprets the file name as a switch (which it doesn't understand).
Method 1: try rm --backup=numbered Method 2, that will *ALWAYS* work: ls -i then, using the inode number find . -inum <inode> -exec rm {} ;
The latter method is the one guaranteed to take care of all kinds of filenames with weird, or unprintable, stuff in the name.
mark
On 04/02/14 10:51, m.roth@5-cent.us wrote:
Frank M. Ramaekers wrote: Method 1: try rm --backup=numbered Method 2, that will *ALWAYS* work: ls -i then, using the inode number find . -inum <inode> -exec rm {} ;
The latter method is the one guaranteed to take care of all kinds of filenames with weird, or unprintable, stuff in the name.
mark
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Use rm -i * It will usually catch the file and because it's a special character it and many other odd ball file names usually appear in the very beginning so you don't have to go through the entire list.