Stop Thinking About Bash Alias Names And Just Define Rules

preview_player
Показать описание
==========Amazon Links==========

==========Support The Channel==========

► BTC Wallet Address: 1Aokiv3pFQXUEmh2LbzZQAwxMvq6bpT2UN

► ETH Wallet Address: 0x80451867c86bdf08c3888d407c1e3fcb6add61ed

► LBC Wallet Address: bLRN9fm17sCexKfgbYqmMj5xskZF2ogpEh

When defining your aliases one thing you have to keep in mind is actually making it so they're easy to remember now there's a bunch of ways that this could be done but one such way is to define a structured rule set that you try to always follow when defining your shell aliases, whether those be bash, fish, zsh or even powershell aliases. Remembering a set of rules is going to be considerably easier than remembering a bunch of random cryptic aliases at least for me anyway.

=========Video Platforms==========

==========Social Media==========

==========My Repos==========

==========Credits==========
🎨 Channel Art:
All my art has was created by Supercozman

🎵 Ending music

DISCLOSURE: Wherever possible I use referral links, which means if you click one of the links in this video or description and make a purchase we may receive a small commission or other compensation.

Рекомендации по теме
Комментарии
Автор

the main aliases I use are:
p="sudo pacman"
v="vim"
s="sudo systemctl"
c="xclip -selection clipboard" (this one's great for piping stdout into your clipboard)

I try to keep em scarce because of the learning by repetition thing another commenter brought up

Jelster
Автор

Mnemonic devices are a great way to remember things (including when cramming for tests). Great vid!

nkodoko
Автор

Because of tab completions I rarely use aliases, except for launching programs with options set.

sentinel
Автор

This would make a great blog post, or a guide posted to GitHub or similar.

sentinel
Автор

Agree. I already use basically the same rules u mentioned. But also I usually never have more than 10 to 12 aliases anyway. I just have some for the most used commands.

kyu
Автор

Thank you for the awesome video. I like software and I want it to be useful. And it's a common problem to find the most efficient way to call an action. It occurs not only with aliases, but also with keybindings (avoid "chords" and make them consistent), the line editor commands (which are also kind of aliases), gui menus (you can make a tree of keystrokes where each leaf is an application)...

simpleprogrammingcodes
Автор

I remember most of them, zsh can help you with that, you even have it. I liked your rules, the logic makes easy. One thing that is good too (even though there is fzf and find) is having rules/patterns to organizing files.

senninscorpion
Автор

One of the things I consider when naming an alias is if I can only use letters that are near each other on the keyboard.
I've written many aliases where the first 2-3 letters are all on the left side of the keyboard.
This lets me hit a few keys and hit tab to immediately get the alias with one hand. (note: I use ZSH)
This is of course an optional rule since it wont be possible for some commands.

ransan
Автор

i typically only alias if i don't want to/can't remember the command and in those cases i give them a descriptive name of what i use them for
like "uphone" to sshfs my ubuntu phone or "dwmsrc" to cd into /etc/local/src/dwm or "mircast" for well this:
"nc -l -p 1234 | gzip -dc | mplayer -demuxer rawvideo -rawvid eo w=384:h=640:format=rgba -"
cheers

fuseteam
Автор

Next video put even more ads in. Its the best content in the video ha ha. Jk Brody. Love you and great topic as usual!

blankexpressionu
Автор

I make acronyms too, it has not failed me yet. All my projects get their own 3 letter acronym also.

eritert
Автор

I still don't have much aliases in my shell, because I tend to use only a few programs, and most of them are for the git command I have used (still a git noob though), and well I use the same method as you do.

antoniocapece
Автор

many different cases, rules, conflicts and exceptions :x
this would be confusing to me :x
assuming the one letter per word rule applies to commands with hyphens
then i would just alias git pull to gpull and git push to gpush aka one letter per rule and tack the final argument
hmm git cherry-pick gitcp muhehehehehe

fuseteam
Автор

Aliases should be used only when you need to rerun same commands constantly with long list options.
I use functions btw XD

tapank