0

How can i rename a file that looks like this:

Some shitty words with spaces and sp?ecial (characters).ext

I tried enclosing in single quotes, i tried enclosing in double quotes. I tried moving

mv Some*.ext test.ext

But anything i do, will result in mv: cannot stat ... no such file or directory.

None of the tips for getting rid of either the question mark or parentheses work, i guess having both of these in a filename is the ultimate reason to get you stuck.

I cant even delete the whole folder...

Thanks for any help!

aslmx
  • 38
  • 3
  • This works fine for me with bash: `touch 'Some shitty words with spaces and sp?ecial (characters).ext'; rm 'Some shitty words with spaces and sp?ecial (characters).ext'` – Cyrus Jun 11 '18 at 18:52
  • 1
    Well, your two commands work for me as well. It seems like the ? is in reality some other character, which is only displayed as a question mark maybe. – aslmx Jun 11 '18 at 18:58
  • What filesystem is this? Can you mount it with other options so then the name is valid? Is the filesystem healthy? – Kamil Maciorowski Jun 11 '18 at 19:12
  • 2
    Good hint with the FS. It is actually a mounted drive from another server. I forgot it is actually not a local drive as it is integrated into the tree structure. I could now login as root on the server and rename the file without any issues. I think it is a Samba share and filesystem is ext4. Mount gives me the following output: //192.168.2.10/share on /mnt/share type cifs (rw,relatime,vers=1.0,cache=strict,username=theuser,domain=workgroup,uid=0,noforceuid,gid=0,noforcegid,addr=192.168.2.10,unix,posixpaths,serverino,mapposix,acl,rsize=1048576,wsize=65536,echo_interval=60,actimeo=1) – aslmx Jun 11 '18 at 19:23
  • 2
    Possible duplicate of [How to delete a file with a weird name?](https://superuser.com/questions/451979/how-to-delete-a-file-with-a-weird-name) – harrymc Jun 11 '18 at 20:01

0 Answers0