به Nostr بپیوندید
2026-07-14 13:00:20 UTC

:rainbowCrow: on Nostr: RE: This got all sorts of fun shell tricks in the replies. If you have more, please ...

RE: https://infosec.exchange/@cR0w/116915966560002695

This got all sorts of fun shell tricks in the replies. If you have more, please add them. They will surely be new to someone.
You know how there are weird tricks with computer stuff that you think everyone knows but they don't? I live learning and teaching new things like those when they come up.

Today's was the carat substitution in bash. It probably works in other shells too but IDK, I'm too old to learn a new shell.

The way it works is fairly similar to the / in sed or similar. You can use them to run the previous command but with a string substitution.

For example, let's say I entered this command: dig A cascadiacrow.org



When it fails to resolve, I realize it was a .com domain. Rather than retyping the command, or hitting the up arrow to change the previous command, you could do this: ^org^com^



And it would run: dig A cascadiacrow.com



Kind of cool with those one liners you spend way too much time on and find a typo.

Anyway, I used it and someone thought it was magic so if it's new to you too, happy Monday.