How to get rid of bad chrs?

Little Girl littlergirl at gmail.com
Wed Aug 4 17:12:45 UTC 2021


Hey there,

Ralf Mardorf via ubuntu-users wrote:

>I'm strictly against parsing terabytes of directory entries to
>automatically rename them, before a backup was made.

I agree wholeheartedly on the backup. It's essential before
attempting structural changes.

As for not parsing terabytes of directory entries to automatically
rename them, everything has its place. I agree that it's quite risky
to do on an entire system that contains operating system directories
and files, additional program directories and files, and user data.
It's safe to do, however, on a directory of controlled data that you
either created or are familiar with and know the structure of.

For instance, if you had a directory with lots of nested
subdirectories and each one contained some number of files that all
start with recipes_ or some other known string, then as long as you
use a renaming command that's well-behaved and will only act on the
current directory and its subdirectories, it would be safe to replace
all those recipes_ with Recipes_ or with nothing or with some other
string.

On the flip side, even in a case like the above example, if
you were to replace just one letter with one other letter instead of
replacing a known string with another string, that could fall over
by turning some of the file names into complete nonsense. Each
situation warrants a "Should I or shouldn't I?" moment before
deciding how to proceed.

>Even if nothing should go wrong, no data should get lost, useful
>names might become completely useless.

Yes. This is always a possibility. That's why I always test, test,
and test some more (with the goal of the tests being to try to get it
to fall over, because that's the most useful fun to be had in
programming) before ever going live with something like that.

-- 
Little Girl

There is no spoon.




More information about the ubuntu-users mailing list