(in reference to problem of file having the name Icon\r where "\r" is
actually a carriage return rather than a backslash followed by a
lower-case r):

What happens if you type "ls -al" while defaulted to this directory?

On 1/28/10, David K Watson <davidkirkwat...@gmail.com> wrote:
> These are good suggestions, and OS X does have a built in
> emacs, just type in "emacs" in Terminal.  If you haven't used
> it before, it is important to remember that you have to type
> ^x^c (x and c with the control key held down) to exit emacs.
>
> However, sidestepping the more technical unix hacks for the
> moment, what happens if you just try to change permissions for
> the file using the Sharing and Permissions section of the Get info
> window?  What are the current owners and permissions for the
> file and for its parent folder?
>
> Getting back to the command line, one thing that occurs to me is
> that you may not have the name exactly right (the uppercase i
> might be a lower case L or there may be a space in the name
> that you're not seeing, for example.  To avoid this, in terminal, type
>
> rm -i
>
> with a space after the -i, then drag the file over the terminal window
> and the path to the file with the correct name will magically appear, with
> special characters like "\" handled appropriately.  Hit the return key,
> and if the only problem was getting the name right, the file should be
> deleted.  If that doesn't work, try it again using sudo, typing
>
> sudo rm -i
>
> and proceeding as before, typing your password at the prompt.
> If you get an error message saying it is a directory, try removing
> the file as above, but with
>
> rm -r
>
> in place of rm -i, and if that fails, try this with sudo.
>
>
>> From:    Michael Fernando <michael....@gmail.com>
>>>
>>> rm -i "Icon\\r"
>>>> rm -i 'Icon\\r'
>>>> rm -i "Icon\r"
>>>> rm -i 'Icon\r'
>>>>
>>>
>>> Alas no.
>>>
>>> Even the dread rm * fails to conquer.
>>>
>>>
>>
>> A couple of ideas:
>>
>> 1) move everything else out of that directory.
>>
>> cd ..
>> \rm -rf <that directory name>
>>
>>
>> 2) I'm not sure if OSX comes with emacs, but I've used emacs' directory
>> mode
>> to delete files with funny characters in the filenames.
>>
>> start emacs
>> ^x^v (that's ctrl-x; ctrl-v) and give the directory name (not the file
>> name)
>> You will get a directory listing.
>> move the cursor to the filename, then "d" for delete
>> Then "x" for expunge the file marked with d.
>> exit emacs with ^x^c
>>
>> 3) (yeah, three is more than a couple ...)
>> Perhaps, a different shell may have better filename completion?  Does OSX
>> have tcsh?
>> start tcsh; then \rm -f Ico<tab> and see if it completes the filename with
>> the proper escape character?
>>
>>
>> Uh ... why can't you use the Finder window to navigate to the file and
>> drag
>> it to Trash?
>
>
> *************************************************************************
> **  List info, subscription management, list rules, archives, privacy  **
> **  policy, calmness, a member map, and more at http://www.cguys.org/  **
> *************************************************************************
>


*************************************************************************
**  List info, subscription management, list rules, archives, privacy  **
**  policy, calmness, a member map, and more at http://www.cguys.org/  **
*************************************************************************

Reply via email to