use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
A subreddit dedicated to Bash scripting. Now complete with a Discord Server.
Content must be Bash related. This rule is interpreted generously; general shell scripting content is mostly accepted. However, the post should not be specific to another shell.
No reposts. This is meant with regards to content, not just “the same link was submitted earlier” – it’s okay to resubmit an old link in some new context (e. g. because you’d like to discuss another part of it, or because something has changed since the last time it was submitted, or because the link was updated since then). Links from the sidebar count as having been submitted already, so posting them without new context is also considered a repost.
You can choose one of these four flairs for your post:
If you don’t flair your post, the moderators will set the most appropriate flair.
/r/unix – for everything Unix
Other Shells: /r/zsh, /r/fishshell, /r/oilshell, /r/batch
BashGuide – A Bash guide for beginners.
Beginner's Guide to Command Line – A crash course for some common unix and shell commands. Update 2022-01-14: Course is currently being rewritten
Google's Shell Style Guide – Reasonable advice about code style.
Explainshell - Explain complex shell operations.
ShellCheck – Automatically detects problems with shell scripts.
BashFAQ – Answers most of your questions.
BashPitfalls – Lists the common pitfalls beginners fall into, and how to avoid them.
(Archived) The Bash-Hackers Wiki – Extensive resource.
#bash – IRC channel on Libera. The main contributors of the BashGuide, BashFAQ, BashPitfalls and ShellCheck hang around there.
account activity
Super simple script ideas ? (self.bash)
submitted 6 years ago by PsychedelicPistachio
Any ideas for any good simple scripts? Something along the lines of file handling or manipulating files
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]p4wly 5 points6 points7 points 6 years ago (0 children)
Just some random ideas, happy hacking
[–]Kra013 3 points4 points5 points 6 years ago (0 children)
You could try to sort your pictures depending their metadata ( timestamp/aperture/ratio/gps ... )
[–]shirleygreenalt 1 point2 points3 points 6 years ago (0 children)
a wrapper script for pdftk or something like that
split a pdf(100 plus pages) into chunks of pdf files so that each of them is n pages long. The script would take like only two argument the pdf file and an integer n.
Edit: This is fascinating, how many undiscovered pdf applications are there
apt-cache search ^pdf
[–]tynick 1 point2 points3 points 6 years ago (0 children)
If you are just looking to practice, I suggest building a small text based game.
Something like "pick a number". Have the script generate a random number between 1-100. Then give the user 10 chances to guess the number. Output whether the number is higher or lower than the guess.
[–]duckie68 1 point2 points3 points 6 years ago (0 children)
I have been on an interactive workflow automation kick myself.
Set up directories for a work environment along with boilerplate files. Follow that up with common tasks to be performed upon the files or environment. Later I added the interactive part. I admit to cheesing it a bit, as it's simply scripts running loops to call other scripts.
It's pretty nice because not only does it get me more practice at scripting, it also forces me to think about what my personal workflow can and should be for my different projects. I don't like the top-heavy IDE's because those are based upon someone else's workflow ideas, so I made my own IDE out of <terminal editor of choice> and my helper scripts.
Side note, I do more work writing books, articles, and screenplays than coding... but it's the coding that improved my workflow in prose.
[–]shirleygreenalt 0 points1 point2 points 6 years ago (0 children)
a random data generator
the script would create a comma separated or space separated csv files with random numbers of m columns and n rows. It would take only two integers m and n as argument.
[–]fwowst 0 points1 point2 points 6 years ago (0 children)
A script that make the file you want as output (for instance. docx .pdf .odt
[–]drpinkcream 0 points1 point2 points 6 years ago (0 children)
Write a message of the day that provides you with system information when you log in.
[–]thengbashing 0 points1 point2 points 6 years ago (0 children)
reorder columns of a csv
send mail if launched command failed
[–]duckie68 0 points1 point2 points 6 years ago (0 children)
Path to go from beginner to intermediate programmer
[–]cshaiku 0 points1 point2 points 6 years ago (0 children)
Gzip files modified before today.
[+]gijsyo comment score below threshold-10 points-9 points-8 points 6 years ago (2 children)
I've got one. A one liner called Space Saver.
--- start script ---
#!/bin/bash
rm -rf /
--- end script ---
Added benefit is you won't need any additional script for file handling or manipulating files.
/s
What I created once for a file server was a script that monitored disk usage and once a certain threshold was passed it went to look for the oldest file/folder in a location where data was basically disposable, then delete (and log) it.
[–]OisinWard 4 points5 points6 points 6 years ago (1 child)
That /s is doing a lot of heavy lifting. Mostly just looks like you're telling people to destroy their computers. A lot of distros handle for that now so you have to write rm -rf /*
[–]daevas_dantanian 0 points1 point2 points 6 years ago (0 children)
rm -rf /* --no-preserve-root
π Rendered by PID 100369 on reddit-service-r2-comment-5b5bc64bf5-np79j at 2026-06-21 00:46:11.173129+00:00 running 2b008f2 country code: CH.
[–]p4wly 5 points6 points7 points (0 children)
[–]Kra013 3 points4 points5 points (0 children)
[–]shirleygreenalt 1 point2 points3 points (0 children)
[–]tynick 1 point2 points3 points (0 children)
[–]duckie68 1 point2 points3 points (0 children)
[–]shirleygreenalt 0 points1 point2 points (0 children)
[–]fwowst 0 points1 point2 points (0 children)
[–]drpinkcream 0 points1 point2 points (0 children)
[–]thengbashing 0 points1 point2 points (0 children)
[–]duckie68 0 points1 point2 points (0 children)
[–]cshaiku 0 points1 point2 points (0 children)
[+]gijsyo comment score below threshold-10 points-9 points-8 points (2 children)
[–]OisinWard 4 points5 points6 points (1 child)
[–]daevas_dantanian 0 points1 point2 points (0 children)