On my Linux Mint 18.3 installation I had troubles with my locale setting which caused the generation of a folder that has invalid encoding in its name.

I would now like to delete said folder but I can't figure out how I can do so. I tried using my file manager (Dolphin) as well as the terminal (sudo rmdir <folder name>) but both commands failed claiming that the given folder doesn't exist.

However, it still gets displayed in the file manager and via the ls command.

sudo rmdir Einf�hrung in die Biochemie/
rmdir: failed to remove 'Einf�hrung': No such file or directory
rmdir: failed to remove 'in': No such file or directory
rmdir: failed to remove 'die': No such file or directory
rmdir: failed to remove 'Biochemie/': No such file or directory

The name of the directory was copied from the output of ls.


You can use the *

sudo rm -rfi Ein*


sudo rm -rfi *Biochemie

Provided there are no other directories that match the pattern, in which case you'll have to pick a pattern that's unique.

You could also use rmdir instead of rm.

As Jeff Schaller pointed out, the -i option will help if the pattern matches directories which are not to be deleted(by prompting for confirmation on each match).

|improve this answer|||||
  • The -i option might be nice. – Jeff Schaller Feb 24 '18 at 15:42
  • Good point, let me add it... – man0v Feb 24 '18 at 15:43
  • That does indeed seem like a good solution as well. However in my case I had a directory called Einführung in die Biochemie as well so it might be a little tricky for that case. But for a "normal" case this seems like a very solid solution. – Raven Feb 24 '18 at 16:06
  • @Raven this will work in your case as well. * matches anything. I've had to use it with cyrilic and chinese characters and it works like charm. – man0v Feb 24 '18 at 16:09
  • 1
    @Raven you can do sudo rm -rfi * and manually pick the ones to get deleted and the ones not to(assuming you have a few files to iterate over). – man0v Feb 24 '18 at 16:23

In such cases, a visual file manager like Thunar is quite handy.

If your system hasn't a GUI, tools like the midnight-commander help a lot.

In simple cases, using command completion might be sufficient.

 rm -i Einf→→

where the → shall symbolize the Tab-key, or, like ManOv showed, maybe an Wildcard is enough:

 rm 'Einf?hrung in die Biochemie'
 rm 'Einf*hrung in die Biochemie'

If you're not allowed to install such modern stuff, find might help:


ls -la Ein*

you can investigate file attributes, like size, modification time, owner, attributes, ... to feed to find:

find -maxdepth 1 -type f -name "Einf*hrung *chemie" -mtime -4 -mtime +2 -size +2000 -size -2200

If the result is just that one specific file, add the delete switch. This works not with all sorts of find, but with GNU-find:

find -maxdepth 1 -type f -name "Einf*hrung *chemie" -mtime -4 -mtime +2 -size +2000 -size -2200 -delete

For other find versions, you'll find a lot of examples, how to delete files, here, too.

|improve this answer|||||

The solution was to rename all other files and folder in the parent directory of said dir that also started with Ein e.g. by prefixing them with a 1_ and then go in the terminal type in sudo rmdir Ein and hitting tab to let the autocomplete-fuction do the rest for me.
That actually resolved the characters accordingly so that I was finally able to delete the directory with that command.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for?Browse other questions tagged or ask your own question.