this post was submitted on 12 Jul 2026
12 points (100.0% liked)

Linux Questions

4042 readers
2 users here now

Linux questions Rules (in addition of the Lemmy.zip rules)

Tips for giving and receiving help

Any rule violations will result in disciplinary actions

founded 3 years ago
MODERATORS
 

I have a rather large library of movies gathered over the years (all entirely legally I assure you officer). I'm in the process of setting up a Jellyfin server so I can stream them on the go.

Currently it's just one folder full of individual files but Jellyfin wants each movie within it's own folder.

Is there a command, or set of commands, that would do this all in one go? ie iterate my way through a folder, create a new folder with the same name as a file, move that file into this new folder and repeat a few hundred times.

I am using Cachy OS (arch) and have Dolphin and yazi as file managers if that helps. I guess a bash script would be the best way to achieve this but my skills are quite rusty.

you are viewing a single comment's thread
view the rest of the comments
[–] HubertManne@piefed.social 1 points 19 hours ago

its a little late but if you rusty you don't even need to get all fancy. You could make a spreadsheet and paste in the first colum mkdir and then get an ls and and paste that list into the second column and then make third column to add the first two columns with a space between. Its kinda more work but cognitively less. you don't have to look up the for. throw that in a text file and make the top line to call bash and run it. If its fine to the same thing where the first column is name and the thirs combines it with name and another adds space name / and the last adds name again. If your folder creation script worked then your header line was fine and you can past this over the move lines of a copy of the file. Either way you do it it would be nice if you have the space to ar up your movies as a backup in case something goes wrong. I mean it shouldn't but im a pretty paranoid guy partially because any time im not I feel I get bit in the trump.