this post was submitted on 16 Feb 2025
152 points (98.1% liked)

Linux

50319 readers
1123 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
 

This is just me celebrating a small win. I've been slowly learning bash scripting, and just now I was able to quickly write a simple bash script to automate a file moving task without referring to my notes or the web!

It's not a super complicated script, I'm just happy I'm starting to internalize the knowledge I've been building.

I've been organizing my media files after ripping our DVD collection. I had all the files for The Smurfs cartoon (love the Smurfs) in the main Smurfs show folder. I wanted to put them all into their respective season folders (Season.XX). Here's the script:

#! /bin/bash

for number in {01..09}; do
	find . -type f -name "The.Smurfs.S$number*" -exec mv {} Season.$number/ \;
done

I could have done it as a one liner, but I like to keep things like this for future reference.

you are viewing a single comment's thread
view the rest of the comments
[–] JubilantJaguar@lemmy.world 16 points 5 days ago (1 children)

Good job. But don't worry if you have to look up answers. I've been at this for 20 years and I still have to look up and double-check basic syntax like the classic find -exec one. No big deal if only takes a couple of seconds.

This is definitely the sort of thing that LLM AI tools can help with, in theory.

[–] MyNameIsRichard@lemmy.ml 5 points 5 days ago

Yeah, you can't keep it all in your head. Knowing what to look up is the better part of the battle.