Batch rename -- Auto rename

20 respostas [Última entrada]
elodie
Desconectado
Joined: 01/31/2014

I'm moving some backup data to Gluglug X60.

I have one torrent with lots of small files. Some, most are already part downloaded by uTorrent. Having Trisquel, I'd use a libre client even if they are big, slow and ugly. But I have to change all '.!ut' appended to '.part'. How do I do that?

Also, some of the files in the backup could be different versions. So when I drop different backups into one folder I would like to have FILE. And when there is a second copy, that should be automatic renamed to FILE_01, than FILE_02 and so on. One solution is to install Wine, than put 7 zip, because that file manager can handle this. But is it some function or app that can do the same native?

teodorescup

I am a member!

Desconectado
Joined: 01/04/2011

For the torrent issue, you can remove the '.!ut'; add the torrent to
your torrent client, setting the new path and let him do a filecheck of
the torrent. After that you can move the torrent files from within the
torrent client to another location and it will move only the verified
files from the torrent so you can safely remove the possible junk files.
For performing batch rename I prefer Thunar's renamer (thunar).

Why would you want to put all you're backups in the same directory ?
I use BackInTime for backups and " cp -a backintime /pathToNewFolder "
to move my backup folder from one drive to another.

Good luck !

--
I use: trisquel.info | ceata.org | fsf.org | riseup.net | duckduckgo.com | eff.org | h-node.com | torproject.org | airvpn.org | flattr.com | skepdic.com |

elodie
Desconectado
Joined: 01/31/2014

> For the torrent issue, you can remove the '.!ut'; add the torrent to your torrent client, setting the new path and let him do a filecheck of the torrent.

Remove. Cool. Meaning batch rename. Thank you Einstein!

> Why would you want to put all you're backups in the same directory ?

When I am going to open up a class, I'll be glad to send you an invite.

GustavoCM

I am a member!

Desconectado
Joined: 11/20/2012

You genius could find something useful when searching for packages with "batch rename" in their descriptions:

$ apt-cache search batch rename
gprename - Complete batch renamer for Linux
gwenrename - Batch renamer tool for KDE
id3ren - id3 tagger and renamer
kipi-plugins - image manipulation/handling plugins for KIPI aware programs
krename - powerful batch renamer for KDE
prefixsuffix - gui application that renames batches of files

You could use Synaptic to search them. It has a GUI also.

elodie
Desconectado
Joined: 01/31/2014

I did that some weeks ago. But thanks for trying.

lembas
Desconectado
Joined: 05/13/2010

>I'd use a libre client even if they are big, slow and ugly
The smallest, fastest and most beautiful clients are libre. You don't even need a bloated GUI.

I don't quite understand what you're doing but you can write a one-liner loop to do that renaming in the terminal or if that's not your forte, there's plenty of GUI renamers to do it for you, e.g. gprename.

for i in *.lut; do mv $i `basename $i .lut`.part; done
elodie
Desconectado
Joined: 01/31/2014

> The smallest, fastest and most beautiful clients are libre. You don't even need a bloated GUI.

In literature, yes. Transmission-gtk takes 20M with NO torrent at all. Azureus/Vuze it's an extreme.

> I don't quite understand what you're doing but you can write a one-liner loop to do that renaming in the terminal or if that's not your forte, there's plenty of GUI renamers to do it for you, e.g. gprename.

Than I have to add find to check in the subfolders. Than I miss some quote. I am aware of the shell commands, but the GUI was meant to do this. The same way I can parse lists of files, fingerprint them and do some sort of a sortable database. Or I can use fslint.

antiesnob
Desconectado
Joined: 08/22/2013

Batch is not for Windows/MS-DOS only?

onpon4
Desconectado
Joined: 05/30/2012

.

megurineturilli
Desconectado
Joined: 01/10/2012

MS-DOS has its well known batch-files[1], but the concept of batch proccessing is much older, it comes from the punched card era[2]

[1] https://en.wikipedia.org/wiki/Batch_file
[2] https://en.wikipedia.org/wiki/Computer_programming_in_the_punched_card_era

antiesnob
Desconectado
Joined: 08/22/2013

So, how do you program in batch in linux? I've only done in bash but I know there are more shells. How can the kernel understand DOS commands?

Legimet
Desconectado
Joined: 12/10/2013

You would have to use Wine for something like that. You can run wine cmd and it will give you a batch prompt. And Linux, the kernel, has nothing to do with bash or batch.

Darksoul71
Desconectado
Joined: 01/04/2012

In common speak (as pointed out int the wiki article linked above) batch files are text files with command sequences. In essence ususal shell scripts, Python or Perl scripts are nothing else:
A sequence of commands which are executed one by one by some interpreter.

And the common writing here is GNU Linux but not Linux. Since Linux ususally only refers to the kernel itself although common speak is quite different here.

Myself I say and write Linux all the day. Especially since 99% of the whole world does the same.

antiesnob
Desconectado
Joined: 08/22/2013

Now I get it. I didn't know that scripting files had a common name. I always called scripting for Windows (DOS not PwerShell or others) batch and scripting for linux "shell scripting" and I always supossed that other OS has its own names for it. Good to know that now.

elodie
Desconectado
Joined: 01/31/2014

Anybody?

How does one rename (GUI) all the files in a folder and all the subfolders from $Name.!ut to $Name.part

How does one move lots of files from one folder to another and IF $Name.$Ext exists THAN rename $Name_$Number.$Ext?

jbar
Desconectado
Joined: 01/22/2011

I don't know any gui application to recursively rename files. I'm afraid you need to do some scripting job.

Maybe rpl will be useful.
http://packages.trisquel.info/toutatis/rpl

edit: my mistake. rpl changes file contents, but doesn't rename files

elodie
Desconectado
Joined: 01/31/2014

Yea, only I'm trying to avoid reinventing the wheel.

antiesnob
Desconectado
Joined: 08/22/2013

Click on "Add/Remove Applications". Search for "rename". There are some results. I never try anyone so you could do it and post which of them is better or has the skills you want for your purpose.

elodie
Desconectado
Joined: 01/31/2014

I find it amazing none has use for such functions. Anyway, tired of wisecracks I went and installed 7zip. It's Windows and does the copy-move and rename very well.

With the tree rename, that's hard as those Gnome-GTK apps don't seem to be able to do it recursively. But it's a job done once. Surprised to find out the lack functionality of the Gnome.

Issue closed.

jbar
Desconectado
Joined: 01/22/2011

Probably the lack of a gui to recursively rename files is because is a potentially dangerous task you have to think twice before you do.

Will such an application follow a symlink? If a target filename already exists, will it be replaced?

You can rename files using 'find' and 'rename' from the command line, or with some lines written in your favorite scripting language.

Be extremely careful with recursiveness.

elodie
Desconectado
Joined: 01/31/2014

> Probably the lack of a gui to recursively rename files is because is a potentially dangerous task you have to think twice before you do.

Hahaha

I like your agument. It might convince a lot of people.

This way audio chat support in Pidgin was a dangerous idea. Or video. You're cute.

> Will such an application follow a symlink? If a target filename already exists, will it be replaced?

Of course, this is exactly the argument for a GUI. Where one can check every option. Just putting a letter after a minus sign is far from intuitive. It happened to more experienced people than me. Also, getting bored after ten pages of man page and doing a copy and paste from a webpage without checking every parameter has happened. I have no idea of your experience in the field, but I have noticed talibans are low on the experience and high on ideology.

> You can rename files using 'find' and 'rename' from the command line, or with some lines written in your favorite scripting language.

For me it was a very interesting reading how the linux-libre project evolved.

> Be extremely careful with recursiveness.

That is a good advice. But don't forget backups work miracles.

May Saint Ignucius guide you!