Also acta

Debian Squeeze with OpenBox

Debian GNU/Linux - Squeeze with OpenBox
If you can walk and chew gum at the same time, you can run GNU/Linux

debian tutorials
debiantutorials.org is built on and runs on Debian.

 

Creative Commons License
Mad Handiness: alias Print E-mail
Friday, 24 December 2010 09:26

It's Christmas Eve morning and we have some snow dust on the ground. The Eskimos might call it 'kanevvluk'. It's also 'nutaryuk' as it's just fallen. We call it lame. If you can still see any ground at all, including leaves, grass, bumps, etc., then there's no snow.

The lucky, sturdy-muthafuckas, living in New England quite enjoy having snow on the ground at Christmas time. It's about sleigh rides, going to see A Christmas Carol at the theatre, snow, fuzzy movies, spiked eggnog, snow, a toasty fireplace, laughter, maybe a little more snow, and some snow. And stuff. It's one of the things about living here that make it worth it.

Man, what a pain in the ass Boston is, and the traffic - anywhere in MA - and the stank politicos we run with...and the cold and the hot and the goddamned 'elite' with their silly affairs and all the other crap we put up with. But the roughness and the beauty more than make up for it. If we get no snow at Christmas time, though, the whole week+ loses a couple tics of awesome.

But that's not what we're here to talk about.

Back in the day I could remember your locker combination if I watched you do it one time. Even from an angle. Those days are long over and I think it may be a universal thing because somebody, some time, added the power user's best friend to bash: alias.

I wrote an article on bash handiness in '07 but it's just another 1/2 baked pile of trash in my 'to-finish' directory. Likely it'll never get done. This morning I read an article someone wrote recently on 'alias' and I figured, 'heh, the 4 people that visit debiantutorials.org may not see this site and this is some handy stuff' so here I am in my pajamas working the wood stove, sipping my decaf, writing this.

What's an 'alias'? It's just what you think it is. Before we get all tripped-up on some wild computer thing, an alias is the same thing it's always been. Like when you're 14 and you think it's bad-ass to go by another name in another town...Heh. For our purposes and alias on your wicked GNU/Linux box is the same. It's another name for a thing. Like a command. Which is very handy because sometimes you just don't feel like typing out long commands, or finding that script you made out if it 8 years ago. Lol, and sometimes you just forget. Being able to use a term you phrase to run a command for you is pretty wicked stuff.

Aside from forgetting or what-have-you, an alias is just plain wicked all by itself for the sake of it. I have many and I use them all the time and even Debian would suck if I couldn't.

As 'alias' is a bash aspect. As such, you run them from your terminal-fu. I know you have yours open all the time anyway. ;) Well, now you can get a little more out of it. Or course, your ~/.bashrc file is where you put your aliases because that's your bash config.

Say you want to update your system because you're running testing and you don't go for the automagic auto-update handiness. In your terminal-fu you may issue:

# aptitude update

OK, so that's a lame example of efficiency because 2 words isn't such a chore. For an alias you may want to merely issue: update, or even simply: u. Of course you cannot update your system as a regular user so you'll employ sudo here in your alias. Make yourself a sudoer first. In the .bashrc file you might have an alias like this:

alias update='sudo aptitude update'

Handy. In fact, don't just sit there. Take advantage. Fire-up your terminal-fu right now, nano .bashrc, and add some aliases to the already superior functionality your system has. See a few of mine and go crazy with your own. Lol, I couldn't remember all my aliases so I added a cheat card for myself in conky. That way they were all right there on my desktop, should I ever see my desktop.

alias sleep='sudo /usr/sbin/pm-suspend'
alias update='sudo aptitude update'
alias upgrade='sudo aptitude full-upgrade'
alias cpf='sudo aptitude clean && sudo aptitude purge ~c && sudo aptitude -f install'
alias search='aptitude search'
alias remove='sudo aptitude --purge remove'
alias install='sudo aptitude --without-recommends install'
alias out='sudo skill -KILL -u bk'
alias again='sudo shutdown -r now'
alias off='sudo shutdown -h now'
alias show='aptitude show'
alias list='dpkg -L'
alias apps='sudo synaptic'
## cryptsetup
alias terms='sudo cryptsetup luksOpen /dev/sdb1 terms && mount /mnt/terms'
alias closeterms='sudo umount /mnt/terms && sudo cryptsetup luksClose terms'
## network ##
alias ports='sudo netstat -nape --inet'
alias ping='ping -c 4'
alias ns='sudo netstat -alnp --protocol=inet'
alias router='opera --newpage --nomail http://192.168.1.1 &'

OK, that about does it. Aliases rock and there ya go. Have the best day. Unplug your box and go play outside. Make your neighbor a pie. Everybody loves pie.

machiner

Comments
Only registered users can write comments!

3.26 Copyright (C) 2008 Compojoom.com / Copyright (C) 2007 Alain Georgette / Copyright (C) 2006 Frantisek Hliva. All rights reserved."