how to delete a file?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Due to an error I made the following file - -rw-r--r-- 1 jos jos0 Nov 19 15:34 - - -rw-r--r-- 1 jos jos 767 Nov 19 15:39 .cshrc drwx-- 3 jos jos 512 Nov 19 15:40 .imap How to delete the - file rm - doesnot work (even with root access) Jack -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (MingW32) - GPGrelay v0.959 iD8DBQFHQaF6Ph5RwW/NzC4RAn22AJ9eTlNKa1oC2b4EUsvp+kxIuetcMwCdGBDa 5UWXoLWBPaqBkaky+K1JQ6c= =Lx8W -END PGP SIGNATURE- ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
how to delete a file?
Jack Raats writes: - -rw-r--r-- 1 jos jos0 Nov 19 15:34 - - -rw-r--r-- 1 jos jos 767 Nov 19 15:39 .cshrc drwx-- 3 jos jos 512 Nov 19 15:40 .imap How to delete the - file rm - doesnot work (even with root access) man rm, section NOTES Robert Huff ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
RE: how to delete a file?
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jack Raats Due to an error I made the following file - -rw-r--r-- 1 jos jos0 Nov 19 15:34 - - -rw-r--r-- 1 jos jos 767 Nov 19 15:39 .cshrc drwx-- 3 jos jos 512 Nov 19 15:40 .imap How to delete the - file rm - doesnot work (even with root access) Jack: rm -- - should do the trick. - barry ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: how to delete a file?
- -rw-r--r-- 1 jos jos0 Nov 19 15:34 - - -rw-r--r-- 1 jos jos 767 Nov 19 15:39 .cshrc drwx-- 3 jos jos 512 Nov 19 15:40 .imap How to delete the - file rm - doesnot work (even with root access) rm -- - will work. everything after -- is forced to be used as filenames not options ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: how to delete a file?
On Mon, Nov 19, 2007 at 03:45:14PM +0100, Jack Raats wrote: Due to an error I made the following file - -rw-r--r-- 1 jos jos0 Nov 19 15:34 - - -rw-r--r-- 1 jos jos 767 Nov 19 15:39 .cshrc drwx-- 3 jos jos 512 Nov 19 15:40 .imap How to delete the - file rm - doesnot work (even with root access) Jack Hello Jack, rm -- ^^ (dont forget to add two of them) -- Jean-Pierre ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: how to delete a file?
On Mon, 2007-11-19 at 15:45 +0100, Jack Raats wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Due to an error I made the following file - -rw-r--r-- 1 jos jos0 Nov 19 15:34 - - -rw-r--r-- 1 jos jos 767 Nov 19 15:39 .cshrc drwx-- 3 jos jos 512 Nov 19 15:40 .imap How to delete the - file rm - doesnot work (even with root access) % rm ./- it works for me. respect, bh -- I'll see you at my father's house. Be sure you bring Paulie. -- Santino Corleone, Chapter 2, page 84 ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: how to delete a file called ????
in message [EMAIL PROTECTED], wrote Matthew Hunt thusly... On Wed, Feb 12, 2003 at 02:21:43PM -0500, parv wrote: find . -inum $( /bin/ls -i | fgrep '?' | awk '{print $1}' ) -print0 \ | xargs -0 rm -f I'm going to go out on a limb and guess that the filename does not really consist of question marks, but rather of unprintable characters that ls displays as '?'. Hey, OP said that file name consisted of '?'. W/o access to OP's system or due to lacking output of (something like) ls -B (FreeBSD 4.7-Release), i rather not guess what-could-be. Me no fs (or people) mind reader. Then again i did write something like before the proposed solution (which you omitted from the quote). :) I recommend finding the inode number of the offending file: $ ls -li total 1 1238024 -rw-rw-r-- 1 mph mph 1 Feb 12 12:07 ? The inode number in this case is 1238024. Then you can double-check and delete it with find: $ find . -inum 1238024 ./+ $ find . -inum 1238024 -delete Exactly my point: use find -inum to find the offending file(s) deal w/ it(them) as appropriate. - parv -- To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-questions in the body of the message
Re: how to delete a file called ????
On Wednesday 12 February 2003 22:54, Andres Aitsen wrote: Ühel kenal päeval (kolmapäev, 12. veebruar 2003 21:45) kirjutas Kent Stewart: On Wednesday 12 February 2003 11:21 am, parv wrote: I have a file called ??? I can't seem to clean it away. rm rm '' rm all do not work. That is a lot of work when you could have just rm -- ??? The -- tells rm that what follows is a file name. Well, simple test showed, what does the job. %touch \?\?\?\?\?\?\?\?\?\?\?\?\?\?\? %ls -l total 0 -rw-r--r-- 1 andres wheel 0 Feb 12 22:50 ??? %rm \?\?\?\?\?\?\?\?\?\?\?\?\?\?\? %ls -l % Andres [EMAIL PROTECTED] Or, if you are using csh: %touch '?' %ls -lh '?' -rw-r--r-- 1 will will 0B Feb 12 22:58 ? %rm '?' %ls -lh '?' ls: ?: No such file or directory % Note, single quotes ('), not double quotes (). The reason for this is that shells will still inspect variables and wild cards inside double quotes. Inside single quotes, you could even put a double quote without having problems. Will To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-questions in the body of the message -- Willie Viljoen Freelance IT Consultant 214 Paul Kruger Avenue, Universitas Bloemfontein 9321 South Africa +27 51 522 15 60 +27 51 522 44 36 (after hours) +27 82 404 03 27 (mobile) [EMAIL PROTECTED] To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-questions in the body of the message
Re: how to delete a file called ????
On Wed, 12 Feb 2003 11:12:32 -0500 David Banning [EMAIL PROTECTED] wrote: Howdy, Yes, the file is a bunch of question marks. I can't seem to clean it away. rm rm '' rm You need to escape the ?, so it doesn't get expanded by the shell. rm \?\?\?\?\?\? should work. You can also use midnight commander (misc/mc) to delete it. Cheers, -- Miguel Mendez - [EMAIL PROTECTED] GPG Public Key :: http://energyhq.homeip.net/files/pubkey.txt EnergyHQ :: http://www.energyhq.tk Of course it runs NetBSD! msg19167/pgp0.pgp Description: PGP signature
Re: how to delete a file called ????
On Wed, Feb 12, 2003 at 11:12:32AM -0500, David Banning wrote: I have a file called ??? have you tried Emacs in dired mode? Yes, the file is a bunch of question marks. I can't seem to clean it away. rm rm '' rm all do not work. To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-questions in the body of the message -- David Bear College of Public Programs/ASU Mail Code 0803 To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-questions in the body of the message
Re: how to delete a file called ????
in message [EMAIL PROTECTED], wrote David Banning thusly... I have a file called ??? ... I can't seem to clean it away. rm rm '' rm all do not work. try something like... find . -inum $( /bin/ls -i | fgrep '?' | awk '{print $1}' ) -print0 \ | xargs -0 rm -f - parv -- To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-questions in the body of the message
Re: how to delete a file called ????
On Wednesday 12 February 2003 11:21 am, parv wrote: in message [EMAIL PROTECTED], wrote David Banning thusly... I have a file called ??? ... I can't seem to clean it away. rm rm '' rm all do not work. try something like... find . -inum $( /bin/ls -i | fgrep '?' | awk '{print $1}' ) -print0 \ | xargs -0 rm -f That is a lot of work when you could have just rm -- ??? The -- tells rm that what follows is a file name. Kent -- Kent Stewart Richland, WA http://users.owt.com/kstewart/index.html To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-questions in the body of the message
Re: how to delete a file called ????
On Wed, Feb 12, 2003 at 02:21:43PM -0500, parv wrote: find . -inum $( /bin/ls -i | fgrep '?' | awk '{print $1}' ) -print0 \ | xargs -0 rm -f I'm going to go out on a limb and guess that the filename does not really consist of question marks, but rather of unprintable characters that ls displays as '?'. Note: # Note that ^A is a literal control-A, typed with control-V control-A $ echo ^A $ ls ? I recommend finding the inode number of the offending file: $ ls -li total 1 1238024 -rw-rw-r-- 1 mph mph 1 Feb 12 12:07 ? The inode number in this case is 1238024. Then you can double-check and delete it with find: $ find . -inum 1238024 ./+ $ find . -inum 1238024 -delete (Note that find displays the name differently from ls. It looks like a bold + in my xterm.) -- Matthew Hunt [EMAIL PROTECTED] * Inertia is a property http://www.pobox.com/~mph/ * of matter. To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-questions in the body of the message
Re: how to delete a file called ????
On Wed, Feb 12, 2003 at 11:45:33AM -0800, Kent Stewart typed: On Wednesday 12 February 2003 11:21 am, parv wrote: in message [EMAIL PROTECTED], wrote David Banning thusly... I have a file called ??? ... I can't seem to clean it away. rm rm '' rm all do not work. try something like... find . -inum $( /bin/ls -i | fgrep '?' | awk '{print $1}' ) -print0 \ | xargs -0 rm -f That is a lot of work when you could have just rm -- ??? This will delete all files that have a name the length of 15 characters. The -- tells rm that what follows is a file name. But first, the ?'s are expanded by the shell to match any file with a name of 15 characters. Kent -- Kent Stewart Richland, WA http://users.owt.com/kstewart/index.html To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-questions in the body of the message To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-questions in the body of the message
Re: how to delete a file called ????
Ühel kenal päeval (kolmapäev, 12. veebruar 2003 21:45) kirjutas Kent Stewart: On Wednesday 12 February 2003 11:21 am, parv wrote: I have a file called ??? I can't seem to clean it away. rm rm '' rm all do not work. That is a lot of work when you could have just rm -- ??? The -- tells rm that what follows is a file name. Well, simple test showed, what does the job. %touch \?\?\?\?\?\?\?\?\?\?\?\?\?\?\? %ls -l total 0 -rw-r--r-- 1 andres wheel 0 Feb 12 22:50 ??? %rm \?\?\?\?\?\?\?\?\?\?\?\?\?\?\? %ls -l % Andres [EMAIL PROTECTED] To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-questions in the body of the message
Re: how to delete a file called ????
On Wednesday 12 February 2003 12:42 pm, Ruben de Groot wrote: On Wed, Feb 12, 2003 at 11:45:33AM -0800, Kent Stewart typed: On Wednesday 12 February 2003 11:21 am, parv wrote: in message [EMAIL PROTECTED], wrote David Banning thusly... I have a file called ??? ... I can't seem to clean it away. rm rm '' rm all do not work. try something like... find . -inum $( /bin/ls -i | fgrep '?' | awk '{print $1}' ) -print0 \ | xargs -0 rm -f That is a lot of work when you could have just rm -- ??? This will delete all files that have a name the length of 15 characters. The -- tells rm that what follows is a file name. But first, the ?'s are expanded by the shell to match any file with a name of 15 characters. I had always used the -i to go along with it. I tried it with ??? and abc and a rm -- ??? deleted both files, which wasn't what I expected if wildcarding was turned off with the --. Kent Kent -- Kent Stewart Richland, WA http://users.owt.com/kstewart/index.html To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-questions in the body of the message To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-questions in the body of the message -- Kent Stewart Richland, WA http://users.owt.com/kstewart/index.html To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-questions in the body of the message
Re: how to delete a file called ????
On Wed, Feb 12, 2003 at 12:59:18PM -0800, Kent Stewart wrote: I had always used the -i to go along with it. I tried it with ??? and abc and a rm -- ??? deleted both files, which wasn't what I expected if wildcarding was turned off with the --. WILDCARD PROCESSING IS NOT TURNED OFF WITH --. Sorry for yelling, but every time someone asks about removing a file with an odd name, wrong notions like this one surface. In Unix, wildcard processing is handled by the shell, not the program you're running. The program you're running gets the wildcard-expanded filenames, and has no idea whether you used a wildcard or typed them by hand. (This explains why mv *.foo *.bar does not work the way a DOS user would expect it to.) -- is an option processed by rm, just like -r or -i. It tells rm to stop processing further options (i.e. treat arguments that start with - as filenames rather than options.) It has nothing to do with wildcard processing, because the wildcards have already been expanded by the time rm even has a chance to weigh its options. -- is the answer to How do I delete a file called -i not How do I delete a file called ???. But some people seem to think they're all the same question. As I've mentioned before in this thread, it's completely possible that the file doesn't even have question marks in its name, anyway, because ls will display unprintable characters as question marks. -- Matthew Hunt [EMAIL PROTECTED] * UNIX is a lever for the http://www.pobox.com/~mph/ * intellect. -J.R. Mashey To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-questions in the body of the message