ask about rsync: how do I write option for ignore permission?
Hi, I was using rsync -anchuv a/ b/ but doing reverse rsync -anchuv b/ a/ I realize that the permissions are not equal between files into a/ and b/ .
I read in man that -p is for preserve permissions
how do I do this: ignore permission? or I should use -apn?
flags chuv is of old use of -r insted of actual (today in use) -a...
Thank you and regards!
https://redd.it/1k3x9xr
@r_bash
Hi, I was using rsync -anchuv a/ b/ but doing reverse rsync -anchuv b/ a/ I realize that the permissions are not equal between files into a/ and b/ .
I read in man that -p is for preserve permissions
how do I do this: ignore permission? or I should use -apn?
flags chuv is of old use of -r insted of actual (today in use) -a...
Thank you and regards!
https://redd.it/1k3x9xr
@r_bash
Reddit
From the bash community on Reddit
Explore this post and more from the bash community
Alternatives to Tabby and MobaXterm?
Are there any Terminals that have these capabilities?
1. Quick commands buttons (like Macros in Moba)
2. The capability of ignoring a key (I use caffeine to have my laptop awake; it uses the F15 key that presses the ~ tilde button on the terminal)
Tabby has started exhibiting issues downloading plugins, and the dev is not that vocal (perhaps busy) about a solution. Moba ,is unfortunate,ly too costly. I use Windterm now, but Windterm cannot ignore the F15 key that caffeine hits.
https://redd.it/1k4783k
@r_bash
Are there any Terminals that have these capabilities?
1. Quick commands buttons (like Macros in Moba)
2. The capability of ignoring a key (I use caffeine to have my laptop awake; it uses the F15 key that presses the ~ tilde button on the terminal)
Tabby has started exhibiting issues downloading plugins, and the dev is not that vocal (perhaps busy) about a solution. Moba ,is unfortunate,ly too costly. I use Windterm now, but Windterm cannot ignore the F15 key that caffeine hits.
https://redd.it/1k4783k
@r_bash
Reddit
From the bash community on Reddit
Explore this post and more from the bash community
Clean up consecutive identical escape sequences?
I have some utf-8 art that my editor saves as ANSI with every single character's fg and bg color defined in an escape sequence. How would i go about making a noscript that would remove every escape sequence that was identical to the previous, but not remove the characters being escaped?
https://redd.it/1k3v650
@r_bash
I have some utf-8 art that my editor saves as ANSI with every single character's fg and bg color defined in an escape sequence. How would i go about making a noscript that would remove every escape sequence that was identical to the previous, but not remove the characters being escaped?
https://redd.it/1k3v650
@r_bash
Reddit
From the bash community on Reddit
Explore this post and more from the bash community
I created a way to display animations as you wait for long running commamds in the terminal.
https://github.com/jorexdeveloper/terminal-animations
https://redd.it/1k3st99
@r_bash
https://github.com/jorexdeveloper/terminal-animations
https://redd.it/1k3st99
@r_bash
GitHub
GitHub - jorexdeveloper/terminal-animations: Show animations for running commands in the terminal.
Show animations for running commands in the terminal. - jorexdeveloper/terminal-animations
forcing three AND conditions to inspect and check contents (against file extension) inside a folder <3.2.5.2 Conditional Constructs>
Hello everyone
Can please someone verify this conditional construct I came up with?
Does it need improvements? Fixes?
Thanks
Explanation:
Example of an invalid set:
-
-
-
https://redd.it/1k3r1jq
@r_bash
Hello everyone
Can please someone verify this conditional construct I came up with?
Does it need improvements? Fixes?
Thanks
cd /some/path/some/movies/moviename
[[ $(ls *.m4a 2>/dev/null) && $(ls *.mkv 2>/dev/null) && $(ls *.srt 2>/dev/null) ]] && printf '%s\n' "Directory \`${PWD##*/}\` has valid contents" || printf '%s\n' WARNING! "Found invalid files into:" "\`${PWD##*/}\`"
Explanation:
folder/ must contain exactly this set only, nothing more nothing less; here's the only valid triplet: .m4a AND .mkv AND .srtExample of an invalid set:
-
moviefolder/-
moviename.mkv-
moviename.srthttps://redd.it/1k3r1jq
@r_bash
Reddit
From the bash community on Reddit
Explore this post and more from the bash community
How can I improve this beginner Bash backup noscript?
Hey folks! 👋 I'm learning Bash noscripting and built a basic backup noscript that creates a `.tar.gz` file of a directory with the current date in the filename.
Here’s what I’ve got so far:
#!/bin/bash
echo "Welcome to the backup program"
BACKUP_FILE="backup_$(date +'%Y-%m-%d_%H-%M-%S').tar.gz"
TARGET_DIR="/mnt/f/Programming/Linux/"
if [ -d "$TARGET_DIR" ]; then
echo "Backing up..."
tar -cvpzf "$BACKUP_FILE" "$TARGET_DIR"
echo "Backup Done ✅"
else
echo "❌ Cannot create backup"
echo "Directory $TARGET_DIR does not exist"
exit 1
fi
It works fine, but I’d love suggestions from more experienced users on how to make it more robust or efficient.
Things like better error handling, logs, user input, or best practices for naming and organizing backups.
Any tips or advice? 🙏
https://redd.it/1k3m9ku
@r_bash
Hey folks! 👋 I'm learning Bash noscripting and built a basic backup noscript that creates a `.tar.gz` file of a directory with the current date in the filename.
Here’s what I’ve got so far:
#!/bin/bash
echo "Welcome to the backup program"
BACKUP_FILE="backup_$(date +'%Y-%m-%d_%H-%M-%S').tar.gz"
TARGET_DIR="/mnt/f/Programming/Linux/"
if [ -d "$TARGET_DIR" ]; then
echo "Backing up..."
tar -cvpzf "$BACKUP_FILE" "$TARGET_DIR"
echo "Backup Done ✅"
else
echo "❌ Cannot create backup"
echo "Directory $TARGET_DIR does not exist"
exit 1
fi
It works fine, but I’d love suggestions from more experienced users on how to make it more robust or efficient.
Things like better error handling, logs, user input, or best practices for naming and organizing backups.
Any tips or advice? 🙏
https://redd.it/1k3m9ku
@r_bash
Reddit
From the bash community on Reddit
Explore this post and more from the bash community
I made this alias to generate commit messages with AI based on the git diff
I just released a little bash noscript that helps you write better Git commit messages using AI, it’s especially handy when you’re upgrading package versions, because it searches for the package changes and describe the improvements of that upgrade.
It uses Gemmini to analyze your
I explained the whole thing in a short write-up here:
👉 How to Write Better Git Commit Messages Using AI
I use it as a git alias but it can be integrated in your workflow in any way you want.
https://redd.it/1k54k5p
@r_bash
I just released a little bash noscript that helps you write better Git commit messages using AI, it’s especially handy when you’re upgrading package versions, because it searches for the package changes and describe the improvements of that upgrade.
It uses Gemmini to analyze your
git diff and automatically generates a clean, meaningful commit message. Perfect for when you don't have much to say about the change or you just want to move forward.I explained the whole thing in a short write-up here:
👉 How to Write Better Git Commit Messages Using AI
I use it as a git alias but it can be integrated in your workflow in any way you want.
https://redd.it/1k54k5p
@r_bash
Linkedin
How to Write Better Git Commit Messages Using AI in the Terminal
I've been thinking about doing this for a while but never had the time..
🧵 Let’s stop calling Bash noscripts “hacky”—here’s how I made a structured Bash framework
I'm tired of seeing solid Bash noscripts dismissed as “unprofessional” just because they don’t come wrapped in some heavyweight framework or runtime.
Meanwhile, we’re seeing simple CLI tools implemented in Node.js or Python, pulling in dozens of dependencies just to call a few system commands or hit a REST API. Why?
The truth is, a lot of modern DevOps tooling is essentially a bunch of noscripts with some wrappers and branding. So why not embrace that and do noscripting right?
That’s why I built **Mush** — a way to organize Bash noscripts like a real project:
Structure your commands like subcommands (`mush <command>`)
Package and distribute noscripts cleanly
Support for configuration, help docs, and testing
No dependencies, just Bash
It’s Bash-first, Unix-friendly, and designed for people who actually like the command line.
Would love your feedback—especially from fellow Bash fans.
Is there a future for structured Bash tooling? Or will it always be seen as the "quick and dirty" option?
https://redd.it/1k54dtx
@r_bash
I'm tired of seeing solid Bash noscripts dismissed as “unprofessional” just because they don’t come wrapped in some heavyweight framework or runtime.
Meanwhile, we’re seeing simple CLI tools implemented in Node.js or Python, pulling in dozens of dependencies just to call a few system commands or hit a REST API. Why?
The truth is, a lot of modern DevOps tooling is essentially a bunch of noscripts with some wrappers and branding. So why not embrace that and do noscripting right?
That’s why I built **Mush** — a way to organize Bash noscripts like a real project:
Structure your commands like subcommands (`mush <command>`)
Package and distribute noscripts cleanly
Support for configuration, help docs, and testing
No dependencies, just Bash
It’s Bash-first, Unix-friendly, and designed for people who actually like the command line.
Would love your feedback—especially from fellow Bash fans.
Is there a future for structured Bash tooling? Or will it always be seen as the "quick and dirty" option?
https://redd.it/1k54dtx
@r_bash
GitHub
GitHub - javanile/mush: Mush, a build system for shell.
Mush, a build system for shell. Contribute to javanile/mush development by creating an account on GitHub.
Command Line Issues Error But Not When Command Immediately Rerun?
1. Code produces error as expected:
`[[ 'a(' == *[(]* ]]`
`-bash: syntax error in conditional expression: unexpected token \`('`
2. Corrected by escaping the open paren but the command line still produces an error (different than the first error; almost as though it is till dealing with the first command some how):
`[[ 'a(' == *[\(]* ]]`
`-bash: syntax error near unexpected token \`'a(''`
3. When I rerun the last command using up arrow/enter, the code now works:
`[[ 'a(' == *[\(]* ]]`
`echo $?`
`0`
Why does the corrected command (2) initially fail?
https://redd.it/1k5f300
@r_bash
1. Code produces error as expected:
`[[ 'a(' == *[(]* ]]`
`-bash: syntax error in conditional expression: unexpected token \`('`
2. Corrected by escaping the open paren but the command line still produces an error (different than the first error; almost as though it is till dealing with the first command some how):
`[[ 'a(' == *[\(]* ]]`
`-bash: syntax error near unexpected token \`'a(''`
3. When I rerun the last command using up arrow/enter, the code now works:
`[[ 'a(' == *[\(]* ]]`
`echo $?`
`0`
Why does the corrected command (2) initially fail?
https://redd.it/1k5f300
@r_bash
Reddit
From the bash community on Reddit
Explore this post and more from the bash community
Shell TUI example for quickly creating interactive command menus
https://github.com/sdcampbell/Bash-TUI-Example
https://redd.it/1k5zbid
@r_bash
https://github.com/sdcampbell/Bash-TUI-Example
https://redd.it/1k5zbid
@r_bash
GitHub
GitHub - sdcampbell/Bash-TUI-Example: A starter package for a Bash TUI program
A starter package for a Bash TUI program. Contribute to sdcampbell/Bash-TUI-Example development by creating an account on GitHub.
How not to get caught out by differences in macos and linux?
I am writing a bash noscript for building containers using Podman. My laptop is a M2 MacOS with bash 3.whatever, and my server uses alma linux (RHEL) 9.5. I aam running the following command to startup a postgres instance:
while read -r line; do
modified_line="${line//:su/$su}"
# modified_line="${modified_line//:\'sp\'/\'$sp\'}"
modified_line="${modified_line//:\'sp\'/'$sp'}"
modified_line="${modified_line//:d/$d}"
modified_line="${modified_line//:u/$u}"
modified_line="${modified_line//:schema/$schema}"
# modified_line="${modified_line//:\'pass\'/\'$pass\'}"
modified_line="${modified_line//:\'pass\'/'$pass'}"
echo "$modified_line" >> $dir/docker-entrypoint-initdb.d/0.0.0-a_modified.sql
done < $dir/migrations/0.0.0-a_users_dbs.sql
`modified_line="${modified_line//:\'sp\'/'$sp'}"` only works on MacOS bash and `# modified_line="${modified_line//:\'sp\'/\'$sp\'}"` only works on the almalinux bash.
The output between the two is vastly different as well. The MacOS version essentially creates a new file with the text replaced as desired, while the linux version writes two copies of the appended output into a new file, neither of which is correct.
How am I supposed to write bash code that is compliant with both systems?? Should I write in fish or another language that isnt subject to these versioning issues? Or should I save the effort and run all of my code in containers, so that I dont have to deal with this MacOS crap?
**Note:** this question isnt about how to fix the code. Im not too proud to say, I turn to chatgpt as often as I need to, but more of how to consider writing bash moving forward.
https://redd.it/1k63nk7
@r_bash
I am writing a bash noscript for building containers using Podman. My laptop is a M2 MacOS with bash 3.whatever, and my server uses alma linux (RHEL) 9.5. I aam running the following command to startup a postgres instance:
while read -r line; do
modified_line="${line//:su/$su}"
# modified_line="${modified_line//:\'sp\'/\'$sp\'}"
modified_line="${modified_line//:\'sp\'/'$sp'}"
modified_line="${modified_line//:d/$d}"
modified_line="${modified_line//:u/$u}"
modified_line="${modified_line//:schema/$schema}"
# modified_line="${modified_line//:\'pass\'/\'$pass\'}"
modified_line="${modified_line//:\'pass\'/'$pass'}"
echo "$modified_line" >> $dir/docker-entrypoint-initdb.d/0.0.0-a_modified.sql
done < $dir/migrations/0.0.0-a_users_dbs.sql
`modified_line="${modified_line//:\'sp\'/'$sp'}"` only works on MacOS bash and `# modified_line="${modified_line//:\'sp\'/\'$sp\'}"` only works on the almalinux bash.
The output between the two is vastly different as well. The MacOS version essentially creates a new file with the text replaced as desired, while the linux version writes two copies of the appended output into a new file, neither of which is correct.
How am I supposed to write bash code that is compliant with both systems?? Should I write in fish or another language that isnt subject to these versioning issues? Or should I save the effort and run all of my code in containers, so that I dont have to deal with this MacOS crap?
**Note:** this question isnt about how to fix the code. Im not too proud to say, I turn to chatgpt as often as I need to, but more of how to consider writing bash moving forward.
https://redd.it/1k63nk7
@r_bash
Reddit
From the bash community on Reddit
Explore this post and more from the bash community
Want to know why your bash noscript is slow? Profile a bash noscript by efficiently logging time deltas for each statement
https://bauer.codes/post/2025/04/bash-profiling/
https://redd.it/1k6i4jq
@r_bash
https://bauer.codes/post/2025/04/bash-profiling/
https://redd.it/1k6i4jq
@r_bash
bauer.codes
bauer.codes | Profiling Bash
profile a bash noscript by efficiently logging time deltas for each statement
I made a CLI to use saved curl requests
I'm slowly going from using GUI apps to just CLI/TUI and while doing that I wanted to ditch Postman as the app I use to test my apis. Looked through a couple of them but none was what I wanted so I made this one.
I'ts called Curlier and it runs .sh files with the curl request inside of it. It's handy cause I can do whatever I want to the curl response inside my .sh file allowing me to just do curly <request_name> and getting the reponse parsed as I want (or whatever I want to do with it tbh).
Idk, felt like sharing it here for people to try it out, contribute and tell me what they think about it.
Kinda new to shell noscripting so be kind.
https://redd.it/1k6im99
@r_bash
I'm slowly going from using GUI apps to just CLI/TUI and while doing that I wanted to ditch Postman as the app I use to test my apis. Looked through a couple of them but none was what I wanted so I made this one.
I'ts called Curlier and it runs .sh files with the curl request inside of it. It's handy cause I can do whatever I want to the curl response inside my .sh file allowing me to just do curly <request_name> and getting the reponse parsed as I want (or whatever I want to do with it tbh).
Idk, felt like sharing it here for people to try it out, contribute and tell me what they think about it.
Kinda new to shell noscripting so be kind.
https://redd.it/1k6im99
@r_bash
GitHub
GitHub - F2BEAR/curlier: A minimal, extensible, and flexible CLI tool to execute saved requests using curl.
A minimal, extensible, and flexible CLI tool to execute saved requests using curl. - F2BEAR/curlier
What's a Bash command or concept that took you way too long to learn, but now you can't live without?
For me, it was using
https://redd.it/1k6n0v5
@r_bash
For me, it was using
xargs properly, once it clicked, it completely changed how I write noscripts. Would love to hear your “Aha!” moments and what finally made things click!https://redd.it/1k6n0v5
@r_bash
Reddit
From the bash community on Reddit
Explore this post and more from the bash community
Is it possible that RSYNC lists all the directories to say that it passes for all of them?
Hello! (thanks to ~~goog~~... translator)
Is it possible that RSYNC lists all the directories to say that it passes for all of them to see if there was something inside them that has changed?
I clarify that I am using RSYNC with origin = Linux and destination (a pendrive) with Fat32.
and finally verbose say that the copy will be small weight something like equiv. to about 1 common.jpg (little transfer little copy).
See this screenshot for see the list o dirs with and without files into them...
of course I understand that dirs below are listed because they have newer files to copy, but upper them, the list is only of dirs.
https://imgbox.com/WoKhKR20
I am testing an SD formatted with Ext4 to try how RSYNC works with Linux origin and destination in both cases.
And in this case of a modest test with few test directories, when I do RSYNC, RSYNc does not list the directories, that is, it does not warn me that I pass through the directories of this small Linux Test Origin Destination (Ext4).
Thanks and greetings!
https://redd.it/1k6rg7h
@r_bash
Hello! (thanks to ~~goog~~... translator)
Is it possible that RSYNC lists all the directories to say that it passes for all of them to see if there was something inside them that has changed?
I clarify that I am using RSYNC with origin = Linux and destination (a pendrive) with Fat32.
and finally verbose say that the copy will be small weight something like equiv. to about 1 common.jpg (little transfer little copy).
See this screenshot for see the list o dirs with and without files into them...
of course I understand that dirs below are listed because they have newer files to copy, but upper them, the list is only of dirs.
https://imgbox.com/WoKhKR20
I am testing an SD formatted with Ext4 to try how RSYNC works with Linux origin and destination in both cases.
And in this case of a modest test with few test directories, when I do RSYNC, RSYNc does not list the directories, that is, it does not warn me that I pass through the directories of this small Linux Test Origin Destination (Ext4).
Thanks and greetings!
https://redd.it/1k6rg7h
@r_bash
Imgbox
imgbox - fast, simple image host
Use imgbox to upload, host and share all your images. It's simple, free and blazing fast!