Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 Oct 2011 14:04:10 -0500 (CDT)
From:      Robert Bonomi <bonomi@mail.r-bonomi.com>
To:        freebsd-questions@freebsd.org, wodfer@gmail.com
Subject:   Re: Help! Can't delete files ...
Message-ID:  <201110191904.p9JJ4Ago092104@mail.r-bonomi.com>
In-Reply-To: <CABgB0xQxYMM91OcBBVGHLB=Px4z4b=bxRnj=gbvbaU1GRTZRQQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
> From owner-freebsd-questions@freebsd.org  Wed Oct 19 13:53:33 2011
> Date: Wed, 19 Oct 2011 20:23:36 +0200
> From: Andy Wodfer <wodfer@gmail.com>
> To: freebsd-questions <freebsd-questions@freebsd.org>
> 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.





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201110191904.p9JJ4Ago092104>