Date: Sat, 30 Nov 2024 18:23:08 +0100 From: Matthias Apitz <guru@unixarea.de> To: freebsd-questions@freebsd.org Subject: Re: shell script for removing unprintable characters in file names Message-ID: <Z0tJ_I_4VP2zBl2F@c720-1400094> In-Reply-To: <86v7w464zp.fsf@bay.localnet> References: <95966dac-9d93-401f-9948-5fcb224a1e1f@nethead.se> <86v7w464zp.fsf@bay.localnet>
next in thread | previous in thread | raw e-mail | index | archive | help
El día sábado, noviembre 30, 2024 a las 08:50:02a. m. -0800, Carl Johnson escribió: > Per olof Ljungmark <peo@nethead.se> writes: > > > Hi, > > > > I am tasked with recovering hundreds or more files created with > > unknown OSs and have unknown characters in the name, replaced with a > > '?'. > > > > Like file?nam?.??? > > > > Please, if you have such a script can you post or email it? Replacing > > the unknown character with anything, like '-' or '_' using whatever > > shell, sh, bash or csh. > You can use the 'file' command to see in which charset the file are encoded, ISO-8859-1 or UTF-8 or ... And then the command 'iconv' to convert them to the charset you need. matthias -- Matthias Apitz, ✉ guru@unixarea.de, http://www.unixarea.de/ +49-176-38902045 Public GnuPG key: http://www.unixarea.de/key.pub Annalena Baerbock: "We are fighting a war against Russia ..." (25.1.2023) I, Matthias, I am not at war with Russia. Я не воюю с Россией. Ich bin nicht im Krieg mit Russland.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Z0tJ_I_4VP2zBl2F>