this post was submitted on 30 Aug 2026
105 points (99.1% liked)
technology
24470 readers
336 users here now
On the road to fully automated luxury gay space communism.
Spreading Linux propaganda since 2020
- Ways to run Microsoft/Adobe and more on Linux
- The Ultimate FOSS Guide For Android
- Great libre software on Windows
- Hey you, the lib still using Chrome. Read this post!
Rules:
- 1. Obviously abide by the sitewide code of conduct. Bigotry will be met with an immediate ban
- 2. This community is about technology. Offtopic is permitted as long as it is kept in the comment sections
- 3. Although this is not /c/libre, FOSS related posting is tolerated, and even welcome in the case of effort posts
- 4. We believe technology should be liberating. As such, avoid promoting proprietary and/or bourgeois technology
- 5. Explanatory posts to correct the potential mistakes a comrade made in a post of their own are allowed, as long as they remain respectful
- 6. No crypto (Bitcoin, NFT, etc.) speculation, unless it is purely informative and not too cringe
- 7. Absolutely no tech bro shit. If you have a good opinion of Silicon Valley billionaires please manifest yourself so we can ban you.
founded 6 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
The cool thing is that you can learn! Python is approachable and shell is an extremely simple language so you could pick either. It's more straight-forward to use shell as you can use all the lovely existing programs by just writing their name, no need to manage libraries/call out to stuff.
sed 's/_/-/ text_with_underscoreswill replace underscores with hyphens for example in the text. so one part of a script renaming everything would be`for filename in *
do
NEWNAME=sed '/_/-/ $filename
mv $filename $NEWNAME
done`
off the top of the dome so maybe a mistake in it.
expansion patterns are stuff like the asterisk above, it matches any character any number of times. So e.g. prefix_* matches all strings that start with prefix_. Regex is a language for describing strings and performing operations on them, you can do stuff like ask for "the string that has 3 letters, none of which are Z, followed by a number between 2 and 8 at least once, then anything. Output a string made of the number, then the rest of the string"
Very powerful for finding and manipulating text, and since all linux software takes text as arguments and outputs text extremely useful for sophisticated software chains (when you compose things with pipes in console to get complex behaviour from simple software).
There is always this learn-to-code but never any specificity.
`for filename in *
do
NEWNAME=sed '/_/-/ $filename
mv $filename $NEWNAME
done`
Hexbear's formatting sucks for copypasting code, that's like pretty simple though I guess.
Ah my beloved
LOAD "*",8,1, that's a classic, I see. Much ado about computer programs...ⓘ Remember to enable JPEG-XL support in your browser, even on your phone!
If you do want your computer to be more comfortable then rather than the nebulous "learn to code" learning to script (simple programs that run from top to bottom) to automate annoying or repetitive tasks is a really good way.
I am biased, I started as a system administrator and learned to program that way (now I'm an ok programmer, slow but I try and make very robust programs that are performant).
On my computer I have a /home/rat/bin/ folder on my PATH variable (that determines how console evaluated "programname command" type entries, it looks on the PATH for programname and invokes it) that I fill with little half baked helpers for myself.
Just yesterday I decided I needed something to remind me to stretch, so I added a little piece of code (literally just "notify-send 'Take a stretch break'") and added a systemd timer unit to call it 20 minutes after boot and twenty minutes after that. There's lots of ways I could improve it (pause when inactivity, overrule DnD, add pausing functions, add a systray applet thing) but no need to start with all that and no need to dive right in to some bloated piece of crap bundling electron for something that just increases how much I stretch.
You'll probably have stuff you do often: clearing out old downloads, searching for files in a particular directory, opening a set of programs together, switching between night and say brightness and volume, renaming stuff, setting up folder structures and so on. If you find yourself repeating something you can ask "Is there a way to just have this happen automatically?"
Linux's POSIX (mostly) compliance makes it really easy because you can just start by going "I guess I'll chain my most common commands together" and worry about adding arguments/error recovery/logs etc if it's ever relevant.
I've done 'rename every file in x folder manually' and I didn't know how scripting, but I knew it would be cool to have. Thanks for chatting in response to my frankly silly bullshit though.
ⓘ Remember to enable JPEG-XL support in your browser, even on your phone!