I
I
IllusionTurtle2014-08-22 11:21:22
linux
IllusionTurtle, 2014-08-22 11:21:22

(Linux) How to find and delete files with incorrect encoding?

Good afternoon.
There are files whose name consists of an incorrect encoding, they are displayed with question marks, BUT they have a format, for example
????????.doc
file format can be any
, you need to delete such files.
they are not searched for by a question mark, since it is not actually a question mark.
All this business by itself through the Linux console.
Thank you.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
romsterdam, 2014-08-22
@IllusionTurtle

by inode number, determine the inode (ls -i) and delete by it find . -inum -exec rm -r {} \; or just rm -i ***

F
Forzenals Voteva, 2014-08-22
@captain_fistashka

From the other side.
Delete any files with non-native encoding in the name.

#!/bin/sh
IFS=$'\n'
for x in $( ls *�* )
do
    rm -f $x
    echo $x
done

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question