I mistyped a directory name when building a project, and embarassingly, now I have a directory I cannot spell, so I can't run rm -rf ..<innomable>
:
> cd buil
build-fix-memleak/ buil�d-master-debug/ build-master-debug ...
> file "buil�d-master-debug"
buil�d-master-debug: cannot open `buil�d-master-debug' (No such file or directory)
> find . -maxdepth 1 -type d -name "bui*"
./build-fix-memleak
./build-master-debug
..
> ls | grep "^buil"
...
build-fix-memleak
build-group-move
build-master
build-master-debug
..
I can't even grep it
How do I remove it without deleting all other build-*
dirs?
EDIT: Okey I actually followed jesse_b comment, and moved everything useful into a temporary directory, cleaned the current, and moved everything back again
build-master-debug
temporarily and thenrm bui*-master-debug
? Or you might be able to justrm buil?d-master-debug
– jesse_b Jul 22 '21 at 12:40ls -b
or some hex-tool should give you the bytes as well. – ibuprofen Jul 22 '21 at 13:16$'code'
format in a glob? Would that even work? – terdon Jul 22 '21 at 13:17mv "$(printf 'Foo\x07\x13Some\xf8Thing')" new
. (Was the thought.). But limited to how ls is implemented.for f in ./*; do printf %s "$f" | xxd -g 1 ; done
is perhaps better for that. – ibuprofen Jul 22 '21 at 14:25file "buil�d-master-debug"
does not work is that�
is a generic replacement symbol for unprintable characters. If one copy it one do not actually copy the real bytes - like one sometimes can in some applications. – ibuprofen Jul 22 '21 at 15:19