Re: Help! Can't delete files ...

2011-10-19 Thread Polytropon
On Wed, 19 Oct 2011 21:32:39 +0200, Andy Wodfer wrote:
> On Wed, Oct 19, 2011 at 9:04 PM, Robert Bonomi 
> wrote:
> 
> > A) learn to use wildcards.
> >
> 
> I know how to use wildcards, but I forgot to tell in my first email that
> there are 4 files that have almost the same filenames, so I couldn't do it
> this way.

In this case, try to use a terminal emulator which does
have support for UTF-8 both on input and on output. Make
sure your charsets are configured properly. With this
preparation, you should (1st) see the correct file names
in your native language and (2nd) be able to enter (or
complete) their filenames as desired on the command line.



> > B) learn to use the '-i' option to rm
> > C) learn to use 'echo' to 'test' filename expansions.
> >
> 
> Thanks! Very useful info.

I may add:

D) Learn to avoid non-ASCII characters in filenames (just
   like whitespaces and "special" characters).

I'm following this rule for my entire "IT career" now and
I'm very pleased by the results. :-)




-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: Help! Can't delete files ...

2011-10-19 Thread Andy Wodfer
On Wed, Oct 19, 2011 at 9:04 PM, Robert Bonomi wrote:

> A) learn to use wildcards.
>

I know how to use wildcards, but I forgot to tell in my first email that
there are 4 files that have almost the same filenames, so I couldn't do it
this way.


> B) learn to use the '-i' option to rm
> C) learn to use 'echo' to 'test' filename expansions.
>

Thanks! Very useful info.

For your 'problem' files, put a  '?' in  anywhere there is a space or a
> 'strange character'.  Check what happens using echo, then use 'rm -i', so
> you make sure that you delete *only* the particular file you intend to.
>
> e.g. for the specific file you cited above try:
>
>   echo 28b?Kjoepesenter?n?ringsg?rdeier.docx
>
> *ASSUMING* that that shows;
>   28b Kjoepesenter n<91>ringsg<86>rdeier.docx
>
> then try:
>   rm -i 28b?Kjoepesenter?n?ringsg?rdeier.docx
>
> Assuming that  it asks yout about deleting the full file name, type a 'y'.
>
> Repeat for each 'problem' file.


Thanks a lot! That did it! :-)

Cheers,
Andy
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: Help! Can't delete files ...

2011-10-19 Thread Robert Bonomi
> From owner-freebsd-questi...@freebsd.org  Wed Oct 19 13:53:33 2011
> Date: Wed, 19 Oct 2011 20:23:36 +0200
> From: Andy Wodfer 
> To: freebsd-questions 
> Subject: Help! Can't delete files ...
>
> A client has uploaded several files through a CMS and these files contain
> Norwegian letters (I think). AE O and A.
>
> I need to delete about 20 files, but I can't do it through the CMS nor by
> command line on this FreeBSD 8.1 STABLE server. There's something with the
> character encoding/keyboard or server setup I think.
>
> Please advice.
>
> This is what a file looks like when I ls:
>
> 28b Kjoepesenter n?ringsg?rdeier.docx
>
> ls | more:
>
> 28b Kjoepesenter n<91>ringsg<86>rdeier.docx
>
> If I try:
>
> # rm 28b Kjoepesenter n<91>ringsg<86>rdeier.docx
> Ambiguous input redirect



A) learn to use wildcards.
B) learn to use the '-i' option to rm
C) learn to use 'echo' to 'test' filename expansions.

For your 'problem' files, put a  '?' in  anywhere there is a space or a
'strange character'.  Check what happens using echo, then use 'rm -i', so
you make sure that you delete *only* the particular file you intend to.

e.g. for the specific file you cited above try:

   echo 28b?Kjoepesenter?n?ringsg?rdeier.docx

*ASSUMING* that that shows;
  28b Kjoepesenter n<91>ringsg<86>rdeier.docx

then try:
   rm -i 28b?Kjoepesenter?n?ringsg?rdeier.docx
  
Assuming that  it asks yout about deleting the full file name, type a 'y'.

Repeat for each 'problem' file.


___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: Help! Can't delete files ...

2011-10-19 Thread Chuck Swiger
Hi--

On Oct 19, 2011, at 11:23 AM, Andy Wodfer wrote:
> I need to delete about 20 files, but I can't do it through the CMS nor by
> command line on this FreeBSD 8.1 STABLE server. There's something with the
> character encoding/keyboard or server setup I think.
> 
> Please advice.
> 
> This is what a file looks like when I ls:
> 
> 28b Kjoepesenter n?ringsg?rdeier.docx

That's probably UTF-8 encoding of the Norwegian string.  You'd need to quote 
the characters in a fashion appropriate for whichever shell you use; but an 
easier way is likely:

  rm -i *Kjoepesenter*

Regards,
-- 
-Chuck

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Help! Can't delete files ...

2011-10-19 Thread Andy Wodfer
A client has uploaded several files through a CMS and these files contain
Norwegian letters (I think). Æ Ø and Å.

I need to delete about 20 files, but I can't do it through the CMS nor by
command line on this FreeBSD 8.1 STABLE server. There's something with the
character encoding/keyboard or server setup I think.

Please advice.

This is what a file looks like when I ls:

28b Kjoepesenter n?ringsg?rdeier.docx

ls | more:

28b Kjoepesenter n<91>ringsg<86>rdeier.docx

If I try:

# rm 28b Kjoepesenter n<91>ringsg<86>rdeier.docx
Ambiguous input redirect

...

Thanks!
Andy
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"