Make sure it really isn't UTF-8.
echo $LANG
; if the returned string didn't end in .UTF-8
, your terminal isn't set to the right encoding.
Tab or wildcard completion, where possible.
If the first character or three is ASCII, try to use tab completion to do the job for you. The remote server will supply the raw bytes, at which point you can just hit return even if it doesn't look like it makes sense.
Obviously tab completion doesn't apply in this case, but as David pointed out you may be able to use a wildcard cd
based on a substring.
Use abstraction.
If you can't transmit the right character codes, not even the first character, you pretty much have to use other tools to solve the problem for you, such as coaxing the find
command to identify only the directory in question and perform a rename on it.
- Use
ls -i
in the parent directory to identify the associated inode.
- Execute
find . -type d -inum inode#
, replacing the inode number as appropriate. If this command works and only returns a single directory (the one you want to rename), then append this to the end of the find command:
-okdir mv {} ILikeThisNameBetter \;
(-okdir
is the variant of -execdir
that prompts for whether or not you really want to do something, which is the right way to go in this case)
Credit to Aaron Bush for the inode approach, I was doing this by file size in a prior revision.
cd "ĂplnÄahĂĄ"
. Doesn't this work :(