Skip to main content
5 of 5
Reorganized post and added another reference.
igal
  • 10.2k
  • 4
  • 45
  • 60

There are a bunch of options for deleting files with non-ascii filenames.

I was able to create and delete a file with the filename under discussion by using ANSI C quoting:

# Create the offending file
touch $'\x3f\x3f\x5b\x3f\x3f\x02\x3f\x3f\xd8\xa9\x3f\x58\x0a'

# Verify that the file was created
ls -lib

# Remove the offending file
rm $'\x3f\x3f\x5b\x3f\x3f\x02\x3f\x3f\xd8\xa9\x3f\x58\x0a'

Take a look at this post:

Here's a command taken from that post that should delete all files in the current directory whose names contain non-ascii characters:

LC_ALL=C find . -maxdepth 0 -name '*[! -~]*' -delete

You can modify the glob pattern or use a regular expression in order to narrow down the matches.

Here's another relevant post:

There's a suggestion there to try deleting by inode. First run ls -lib to find the inode of the offending file, and then run the following command to delete it:

find . -maxdepth 1 -inum ${INODE_NUM} -delete

You might also find the following article to be generally useful:

igal
  • 10.2k
  • 4
  • 45
  • 60