this post was submitted on 18 Aug 2023
-30 points (32.1% liked)

Linux

45573 readers
1111 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS
 

I run Mylar on my Xubuntu server to manage my comic collection. I found out recently that there's a tool that can convert the embedded .jpgs to .webp to save space, but it only works on cbz files and not cbr (zipped vs rar for those who don't know). I wanted to convert all of my cbr to cbz so that I could run the tool on all my comics, so I needed to search hundreds of subdirectories for them and move them to the same folder to be processed.

Under Windows, I'd just type *.cbr into the search bar built into Explorer from the root comic directory, hit enter to get a list of files, select them all, and move them to the new folder. On Xubuntu, it's nothing like as simple.

I found the search option in Thunar which opened Catfish, typed in *.cbr, and got a no files found message. After looking through the very limited options, I started searching for a way to do it. About thirty minutes later I'd found dozens of links telling me to use different, Terminal only, tools, but nothing about how to search subdirectories from the Catfish GUI. Purely by accident, I found a post from 2012 that mentioned the fact that Catfish doesn't use wildcards, so just search with .cbr, something that's not mentioned in the official docs.

I tried it, and it searched the subdirectories too, and found my files! Except there was no way to copy or cut and paste, just open, show in file manager, copy location, save as, or delete. No good options for almost 500 files across several dozen locations.

I ended up asking Chat GPT how to do it, and doing it through the Terminal, using this:

'find . -type f -name "*.cbr" -exec mv {} /path/to/destination ;'

This is pretty basic functionality, and I had to resort to getting help to use the Terminal :(

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 1 points 10 months ago (3 children)

I don't even know where to begin. First of all if you want Linux to be Windows you're going to have a bad time, the sooner you accept that Linux is a different OS and does things differently, the sooner you might start to learn it. This is one of the most common mistakes, with people trying to download .exe to install things to people expecting every single tool to behave the same. Not to mention xfce is not the only DE and Thunar is not the only file explorer, unlike Windows you have options to choose if you're not satisfied with a specific program, even file explorer.

Secondly that way is stupid even in windows, you're destroying all of the organisation you had with no possible way of recovering it. How do you plan on putting the comics back into the folders they were on before you moved them all to a single folder?

Thirdly and perhaps the most important advice I can give you, don't run random code you find on the internet, especially true for AI generated content.

How would I had done this? A quick search in Google for convert cbz JPG to webp showed me this script https://github.com/azuravian/cbz_jpg-to-webp/blob/main/cbz_JPG-to-WEBP.py which might be what you're using, looking at the help of that script it seems it acts recursively on folders and subfolders and also works with CBR. Unfortunately for you you tried to use it the windows way and so we're limited to whatever GUI is written for it. In fact most scripts would accept a parameter for the file to convert, so a small knowledge in terminal would allow you to do this for EVERY script.

The terminal is not your enemy, you're hampering yourself because you're trying to do complex stuff in the GUI which is not capable of complex stuff.

Finally, you say the documentation of Thunar does not mention wildcards as a point in your favour of "this is confusing", it's not, when a documentation doesn't mention something in general that something is not supported. If I had tried to use a proper regexp on windows finder I couldn't point to the docs not mentioning it to say "it's confusing that they don't mention they don't support regular expressions". The reason Thunar doesn't bother is that 99.999% of the time when a user searches x what he means is really the regexp .*x.*, so that's what it does, if you want something more advanced there are other tools for the job.

[–] [email protected] 3 points 10 months ago (2 children)

I didn't say at any point that I want Linux to behave like Windows, I just used Windows as an example of how easy it should be to use a GUI file manager to carry out very basic file operations. Why do people on this community sem to assume that just because I don't like the way that something works that I don't know how to do anything? It's quite condescending.

Secondly that way is stupid even in windows, you’re destroying all of the organisation you had with no possible way of recovering it. How do you plan on putting the comics back into the folders they were on before you moved them all to a single folder?

No, I didn't. My first sentence says that I run Mylar to manage the comics. I moved the files into Mylar's watch folder so that it would pick them up and process them again. Since I added the cbr comics, I've turned on an option in Mylar that automatically converts new comics to cbz. While doing this, it renames them according to the name of the comic series, and adds metadata to the cbz file that is not in the cbr. While I probably could have found another way to do this, I already have Mylar up and running. Why would I make more work for myself when I have an existing tool that does it automatically and to my pre set preferences?

As far as running random code goes, I'd already found several examples of find being used to find files, and mv is a pretty straightforward command. While I could have put the string together myself with a little bit more searching, I tried Chat GPT to see if there was a GUI based way to do it. Not because I don't like to use the terminal, but because I thought I must be missing something. Basic file operations are pretty much the whole point of file managers, so finding out that Thunar and Catfish couldn't perform a basic task was a bit of a shock. It's not a complex task for a GUI, and other OSes, and apparently other file managers according to some of the replies, can do this very easily.

The script you found is the one I will be using, but I haven't done anything with it yet. I was doing what should have been basic maintenance on the files I wanted to convert. I did make a simple mistake, in that I read somewhere else that the script couldn't handle cbr files, and didn't double check before I started getting everything ready.

It was the Catfish documentation that doesn't mention wildcards, and I didn't think that was odd because wildcards are used pretty much everywhere, plus, the documentation didn't cover very much.

The reason Thunar doesn’t bother is that 99.999% of the time when a user searches x what he means is really the regexp .x., so that’s what it does

That's part of the problem. They know that wildcards are so commonplace that they assume that it's what someone means. In itself it's not a major problem, but a message saying something like 'You searched for *.cbr, did you mean to search for .cbr?' might have been more helpful than just a blank results screen.

[–] [email protected] 4 points 10 months ago

Why do people on this community sem to assume that just because I don’t like the way that something works that I don’t know how to do anything? It’s quite condescending.

Probably because many of us have seen really snide "This is why nobody uses your stupid shitty OS!!" posts/comments so much that "Here's why people don't use Linux" for 2435808th time this month just sounds like another condescending prick come to tell us how stupid we are for using "bad" software that doesn't work like they expect it to. I see that you seem more reasonable than that but I've also seen others around here with really crappy attitudes and ideas who've maybe stirred up a bit of a defensive mood that your phrasing stepped on.

...Now I've got to go before I also go off on a rant. Here is a virtual pancakes: 🫴🥞

load more comments (1 replies)
load more comments (1 replies)