I want to rename file with weird name to something reasonable, however I'm not able to :/
$ mv *_000c.jpg 000c.jpg
mv: cannot move '?j?Z?R?C1_000c.jpg' to '000c.jpg': No such file or directory
I've tried using inode number as was recommend in few places on the internet:
$ ls -il *000c.jpg
ls: '?j?Z?R?C1_000c.jpg': No such file or directory
213915 -rw-r--r-- 1 wolf wolf 794655 Jul 21 2012 '?j?Z?R?C1_000c.jpg'
$ find . -inum 213915 -print0 | xargs -0 -I '{}' mv '{}' 000c.jpg
mv: cannot move './?j?Z?R?C1_000c.jpg' to '000c.jpg': No such file or directory
What should I do?
*
char. So like that:mv \*_000c.jpg 000c.jpg
– ddnomad Apr 12 '17 at 13:47*
seems to be wanted by OP.?j?Z?R?C1_000c.jpg
is the actual name of the file to move. – lgeorget Apr 12 '17 at 13:49ls
in that directory? Is the file shown as a regular file? I am asking to make sure that theNo such file or directory
is a globbing error and not indicative of a damaged file system. – terdon Apr 12 '17 at 13:50fsck
? I may be corrupted. How did the file acquire that name? – Kusalananda Apr 12 '17 at 13:50mv -v \?j\?Z\?R\?C1000c.jpg 000c.jpg
work? – Mio Rin Apr 12 '17 at 13:53mv: cannot stat '?j?Z?R?C1000c.jpg': No such file or directory
– graywolf Apr 12 '17 at 13:53ls
) – Kusalananda Apr 12 '17 at 13:54?
for letters that it can't display. Try switching to a fully unicode font. – Mio Rin Apr 12 '17 at 13:55*_000c.jpg
but thatmv
then can't process the file. This is, IMHO, indicative of a corrupt filesystem. ... or possibly of a filesystem that's mounted on a network share that's gone away (with the directory entries still cached), or something. – Kusalananda Apr 12 '17 at 13:59touch '?j?Z?R?C1_000c.jpg'
in an empty directory. You will then be able to manipulate the file normally as you have tried in your question. The fact that you can't suggests there's something wrong and that doesn't depend on the file name. Can you runfor f in *; do file "$f"; done
? What does that return? – terdon Apr 12 '17 at 14:02