Ask HN: Do you use the bash alias feature much?
I tend to forget aliases I've set up and mostly use Ctrl+R to reverse search history and find the command I want if I've used it before. Either that or "history | grep <command_used_before>" if it was some time in the past. Aliases just don't stick in my memory.
10 comments
[ 4.2 ms ] story [ 39.2 ms ] threadpbpaste () { powershell.exe -noprofile -command Get-Clipboard }
pbcopy () { clip.exe < "${1:-/dev/stdin}" }
yt () { youtube-dl -fmp4 --no-check-certificate `pbpaste` }
None of these would work as aliases, unless you only want them to keep doing whatever they did in the first invocation every time thereafter. Eg: as an alias, yt would be limited to downloading the same video over and over again.
I almost always prefer to use what's available by default, that way what I memorize works anywhere.
But yes, for basic arguments, particularly for ls:
Occasionally for other commands for which the default is not ideal. w3m, for example, will read the bookmarks file if URL is passed, with '-B', but otherwise exits with an error, which is annoying. Git commands, as others note.functions only for the complicated parts. about the same number of bash aliases as .gitconfig aliases.
https://en.wikipedia.org/wiki/Memory_span
`$ alias` will show you your aliases, and it's a pretty easy command to remember ;)