blogs.techrepublic.com.com — The Linux desktop has come a long, long way, but there are still times when I have to use the command line. (I am a hardcore user, after all.) But even though I?m used to typing, spending hours upon hours with my fingers at the keyboard, I still grow tired of typing the same commands over and over. To reduce that tedium, I always add aliases to my
Jul 10, 2008 View in Crawl 4
Closed AccountJul 11, 2008
If you are just using aliases to save typing or because you you can't remember the seldom used command, it serves the same purpose.
bj1989Jul 11, 2008
What seems obvious to you might not be obvious to everyone.
ryebryeJul 11, 2008
It's in Fedora and RHEL also. I actually hate it.
erlkonigJul 14, 2008
Stupid, puerile old tripe, misconceived, poorly demonstrated, and somewhat dangerous.Any bash user should use functions, not aliases - a crippled holdover from the C shell, but with bonus quirks even csh didn't have. Aliases are dead unless you actually need that part that says "If the last character of the alias value is a blank, then the next command word following the alias is also checked for alias expansion."If you're using them to allow the creation of an alias with the same name as the command it calls - well, that's *already* a bad idea.But merely using "alias" is not the limit of this piece's sins. Note the spelling of "alias" as "Alias" early on, ignoring case significance. Later we have the crippling "server_name=.." cruft with no attention paid to what the server might be named (say... "shutdown"), etc. Love the especially stupid use of "IP ADDRESS" in #1, where the real objective would be to use bash autocompletion with ssh triggering pulling the completion list from the ~/.ssh files - which would be seriously useful info to see in a Digg article. Sure it's not trivial, but it's *useful*, and wouldn't the bits wasted on this article have been better applied to something useful - or was that just the lame best the author had to offer?Better examples:Let's not screw up the ability to call "ls" easily, and in fact, why waste all of those extra presses of "s" when we can just use an ell?l () { ls -FCas "$@"; }Here's a better "rm" than that ridiculous one that trains users it's okay to include the filename of files you don't want to delete in your rm command line. As a sysadmin, I'm tired of the side effects of *that*, thank you.rm () { ls -FCsd "$@"; local reply; echon 'remove[ny]? '; read reply; if [ "_$reply" = "_y" ]; then /bin/rm -rf "$@"; else echo '(cancelled)'; fi}Aliases in bash are an abomination - the only alias command anyone should use is "unalias *", to get rid of similar idiocy forced on users by certain system-wide startup files written by the same kind of idiots that wrote /etc/profile files (which should be read at login only) that check to see if bash is reading them and then read the /etc/bash.bashrc file - which completely violates the documented start order in the bash manual page, and breaks startup order for the users who actually knew what they were doing.Bash is its own creature, and should be treated as such - not like another csh, and not like the Bourne sh. The /etc/profile shouldn't need to have bash code in it, because for the most part the only thing it should be doing is setting up environment variables.
Closed AccountJul 14, 2008
buried, trivial aliases, not worth the noiseI'd rather give points to some of the great notes posted here :)