Top
Best
New

Posted by theblazehen 2 days ago

Start all of your commands with a comma(rhodesmill.org)
187 points | 54 commentspage 2
laughing_snyder 2 hours ago|
> Like many Unix users, I long ago created a ~/bin/ directory in my home directory

`.local/bin` seems to be much more common in my experience for this use case. And for good reason.

Levitating 2 hours ago||
~/bin is actually created per default on OpenSUSE (though it's removal has been discussed several times).
zhouzhao 2 hours ago||
Unclutter your $HOME!
jph 2 hours ago||
Clever hack! <3 I also do namespacing yet in a different way.

I create a home directory "x" for executables that I want to manage as files, and don't want on PATH or as alias.

To run foo: ~/x/foo

For example I have GNU date as ~/x/date so it's independent of the system BSD date.

tezza 2 hours ago||
This is a really good practical step if you worry about name collisions

quick, easy and consistent. entirely voluntary.

Bravo

sevg 3 hours ago||
This is one of those ideas that is so simple and elegant that it makes you think “why did I never think of doing this?!”

Neat trick! I don’t think I’ll namespace everything this way, because there’s some aliases and commands I run so often that the comma would get annoying, but for other less frequently used helper scripts then this will be perfect!

bonzini 2 hours ago||
I do something similar with build trees, naming them +build, +cross-arm etc.

This convention was suggested by the GNU Arch version control system years ago (maybe 20??), but it's really useful for the same tab completion reason and I have kept it for almost two decades, even when I switched to git.

amszmidt 1 hour ago||
It was suggested by Tom Lord (RIP), who used it heavily long before he wrote GNU Arch.

File names or directories starting with a comma where considered “junk”, and ones with a plus sign I think where considered “precious”.

pjerem 3 hours ago||
Maybe then try ending your commands with a comma so that you don’t break first-char autocomplete !
stavros 3 hours ago||
But that's the killer feature for me! I always forget the little commands I've written over the years, whereas a leading comma will easily let me list them.
skerit 2 hours ago||
I would have never thought of that. Funny that a comma can be used like that.

Off-topic: What the hell is that font on this website? And why does the "a" look like that?

feelamee 2 hours ago||
can someone explain security consideration of placing scripts into $HOME? Some time ago I moved all my scripts to /usr/local/bin, because I feel that this is better from security perspective.
layer8 46 minutes ago||
Someone with access to your home dir can also set your $PATH and aliases to anything they want, so I don’t see any extra security considerations here.
Galanwe 1 hour ago||
There are no security implications, on the contrary.

It is objectively cleaner to keep your user scripts in your home, that way they are only in _your_ PATH, whereas putting them in /usr/[local/]bin implicitly adds them to every [service] user on the machine, which I can see creating obscure undesired effets.

Not even mentioning the potential issues with packages that could override your scripts at install, unexpected shadowing of service binaries, setuid security implications, etc.

1vuio0pswjnm7 3 hours ago||
I use a different prefix character, e.g. "[", but I have been doing this for years

I started using a prefix because I like very short script names that are easy to type

I prefer giving scripts numbers instead of names

Something like "[number"

I use prefixes and suffixes to group related scripts together, e.g., scripts that run other scripts

I have an executable directory like ~/bin but it's not called bin. It contains 100s of short scripts

feelamee 1 hour ago|
do you publish dotfiles and scripts anywhere? I'm interested to see them
karolist 3 hours ago||
Interesting, though I never had enough custom scripts to justify this, I prefer oh-my-zsh plugin style short aliases instead, i.e. https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/git
falloutx 3 hours ago||
Finally a post that is relevant to what I have been looking for quite some time.

Also, kudos to keeping it so concise and to the point, thats some prime writing.

dadandang 3 hours ago|
,Start all of your commands with a comma
zdc1 2 hours ago||
Should be titled Prefix your script names with a comma. Current title is a little clickbait-y through its ambiguity.
albert_e 2 hours ago||
Agree.

I thought the title meant I should type ,ls instead of ls.

JamesTRexx 2 hours ago||
,sudo make me a sammich

Like so?

More comments...