How to get rid of bad chrs?

rikona rikona at sonic.net
Mon Aug 2 20:06:53 UTC 2021


On Mon, 2 Aug 2021 11:57:27 -0400
Little Girl <littlergirl at gmail.com> wrote:

> Hey there,
> 
> rikona wrote:
> >Little Girl wrote:  
> 
> >> This command replaces all instances of lower-case a with
> >> lower-case b in the name of every file and sub-folder in the
> >> current directory, but    
> 
> >Just installed rename and may try this.  
> 
> Sorry about that. I've been using it for so long that I had forgotten
> whether it was a default program or one that had to be added on.

Not a problem - I understand that concept. :-)

> >> doesn't affect the contents of any sub-folders:    
> 
> >So it is not recursive?  
> 
> That particular example isn't.
> 
> > I didn't see a flag to do that.  
> 
> Me neither. It would have been nice if they had built that ability
> into the command.

Agreed. Looks like that will not work for me.

> > A bit of a problem - I have perhaps 2000 folders in a rather deep
> > structure. Too many to do 1 by 1. Given maybe 100K files, this
> > whole idea makes me rather nervous. :-) Only a couple hundred bad
> > ones - may be safer to do them by hand...  
> 
> Yes, definitely. Actually, no matter how many you have, it's always
> safer to do them manually. In fact, with 2,000 folders, I wouldn't
> dare run a command on them to allow it to climb inside of all of them
> and do its thing.

As I'm learning more and more about the many potential problems, I'm
about at the same point. Manual is looking better and better...

> Normally, I'd recommend FSlint for this job, but they didn't update
> it to work with Python 3, so it's no longer available in the current
> Ubuntu releases. That's a shame. It can find duplicates, installed
> packages, bad names, name clashes, temp files, bad symlinks, bad IDs,
> empty directories, non-stripped binaries, and redundant whitespace.
> It's simply magical. With that program, though, you would still need
> to make decisions on what to do with each file that's found, but at
> least you get a good look at your situation, which is always the
> safest way of making structural changes. I had a lot of duplicate
> photos and it took me a long time to go through them all to make
> certain of what ought to be gotten rid of, but FSlint at least made
> the process gentle and safe. I'm about to switch to the latest LTS
> and will sorely miss this program. I sure hope they update it.

Totally agree - FSlint was a GREAT pgm!! Used it a lot. Still hoping
someone will update it. Have not found a good replacement.

Re multiple photos, check out Geeqie - it also has a dup finder that
looks much nicer and seems more reliable than FSlint. Seems to have a
better dup photo algorithm.

> If you're still looking for a command to recursively rename select
> files, there are a number of them, but you'll want to explore them,
> research them, and test them very thoroughly on dummy directories
> first before ever turning them loose on your system.
> 
> I messed around with several commands today and so far all of them
> fell over when it came to renaming subdirectories and files. They'd
> rename a subdirectory before renaming the files inside of it and then
> confuse themselves by not being able to find and rename the files
> inside of it because they had changed their path. Now that's just
> plain irony. I'll let you know if I come across any that seem to be
> rock-solid without confusing themselves.

Thanks much, but I'm about to adopt your 'too risky' view and do them
by hand. I've gone from 'nervous' to 'downright afraid'. :-)






More information about the ubuntu-users mailing list