[SOLVED] How to remove this file with abnormal character in its name?
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
How to remove this file with abnormal character in its name?
I am running Linux Debian Stable which is working fine. But I have a file on an ext4 partition which has an abnormal character in it. Now I cannot rename this file, nor can I delete it (even as root through sudo). This file also does not open (its supposed to be a pdf file). The 'cat' command with this file's name produces the response: : No such file or directory
I tried scanning the partition with the command: sudo e2fsck -f -y -v /dev/sda5 . It finished without reporting any error.
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680
Rep:
What is the name of the file, which character is causing the issues? I usually press tab and let the shell's autocomplete take care of oddly-named files -- either that or use quotes or wildcards where appropriate (for example rm *.pdf).
The character in question is most likely a non-ASCII character encoded in an unexpected encoding. The "convmv" command can help with renaming the file and converting to the default encoding at the same time. The default encoding should be "UTF-8" nowadays.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.