3 ms·
Yeah, that's true. My bullet point wasn't a very good one-liner. Aliases are nice because they're the most entry-level customization yet they solve the #1 thin
by danneu 13y ago
Yeah, that's true. My bullet point wasn't a very good one-liner.
Aliases are nice because they're the most entry-level customization yet they solve the #1 thing I spent my time doing at the very beginning: hunting down magical incantations on google. When I found one that helped me immediately, I'd collect it in my .bashrc like a pokeball. I had a lot of teeth to cut before I started looking for solutions that were solved with functions.
However, autocompletion based off history is a volatile convenience to me, not something that I feel obviates the need for aliases. Depending on ctrl-r to find `tar -xzvf` isn't much different than autocompleting your own `untar` alias. Except that when `tar -xzvf` isn't in your history anymore as a noob (fresh VPS/fresh shell/different computer), then you're back on Google/manpages to find the incantation so that it's in your history once again.
Besides, here's a simple example of the sort of abstractions I'm talking about:
transmission-edit -> sudo vim /etc/transmission-daemon/settings.json
transmission-start -> sudo start transmission-daemon
transmission-stop -> sudo stop transmission-daemon
...
I type "trans" and then hit tab. All my Transmission-Daemon related stuff is right there ready for autocompletion. I don't have to think about files or locations or paths. I don't have to remember that transmission-daemon is set up as a service. And I especially don't have to remember that its config is a .json file named 'settings' in `/etc/transmission-daemon/`.
This is me just talking aloud.
fasd looks great. Thanks.
- belovedeagle 13y agoWhile aliases may be great for saving time typing, you can use them to steal from yourself the opportunity to learn how unix commands like 'tar' work. Frankly, tar should never seem like an "incantation", because most of the flags are there as shortcuts. From your example, -f and -z are shortcuts for certain pipes and redirects. 'tar -xzvf file.gz' is equivalent to 'zcat file.gz | tar -xv'; and of course the -v is unnecessary so you have 'zcat file.gz | tar x', which is a lot clearer than 'untar', which won't work for tar.bz2 files, or even plain old .tar files (but, just switch zcat to bzcat and you're golden).
- danneu 13y agoI feel like everyone who has responded to me so far plugged that coax cable from The Matrix into the back of their brain stem one day and just downloaded Everything Unix. I don't really relate to a single comment. I call it an incantation because you're on your couch eating a frozen meal at 7:30pm on a Tuesday night with your laptop in front of you. The TV is on, but it's muted so it sits in the limbo between a social coping device and a distraction for the few hours you have between the commute from work and bedtime. Yeah, one day you want to learn more about Unix and tar and how electrons flow on a circuit board and maybe what gravity is -- like, what it really is --, but tonight you just want to get nginx set up for the first time on your linode so it can serve your hand-rolled blog and move the needle just enough so you feel like you're making some progress in life. You've managed to use `wget` to download nginx-1.2.9.tar.gz onto your VPS. And all you want to do next is get the files out of tar.gz. You'd love to right click it and select "Uncompress" from a context menu, but it's in a terminal window. For now you just google "ubuntu uncompress tar", click the first result, and copy the incantation into .bashrc aliased to `untar` for future reference before pressing forward into the abyss.