Sep 092011
 

Alias are a great tool to help increment your productivity on the terminal with bash (or any shell program you’re using), but usually we are too lazy to think at what are the most common, or long commands that we use frequently and prepare an alias for them.

And so someone has done a small piece of software to do this job: aliaser

Aliaser helps you identify frequently typed commands and creates bash aliases for them. Aliaser analyses your bash history and helps you identify commands that you use frequently.

Installation

This small gem it’s a python program, distributed as a a.tar.gz archive.
So download aliaser0.1, untar it and run as root the install script:

cd /tmp/
wget http://aliaser.googlecode.com/files/aliaser0.1.tar.gz
tar zxvf aliaser0.1.tar.gz
cd aliaser
sudo ./install

This will print the following message

installing ...
basic installation done.
Please follow these steps carefully to complete installation.
 
run the following command
mkdir ~/.aliaser; touch ~/.aliaser/aliases.sh
 
add the following commands to your .bashrc .
 
source ~/.aliaser/aliases.sh
/usr/bin/aliaser
/usr/bin/aliaser show-tips

So follow these instructions and do:

cd
mkdir ~/.aliaser 
touch ~/.aliaser/aliases.sh
echo "source ~/.aliaser/aliases.sh
/usr/bin/aliaser
/usr/bin/aliaser show-tips" >> .bashrc

Please note: This program will work only with bash, it uses specific bash files, so you cannot use it with zsh or other shells.

Basic usage

On your next login you’ll see something like that:

[ 0]	037 times	aptitude search
[ 1]	030 times	aptitude install
[ 2]	012 times	sudo apt-get
[ 3]	010 times	/etc/init.d/dnsmasq
Choice (empty to ignore all, CTRL+C to cancel): 0

For the moment just hit retun to ignore this.
The most useful options for starting with aliaser are:

aliaser Analyses bash history and prompts you to create aliases for most frequent commands.

aliaser add "" Add a new alias eg: aliaser add ssh43 "ssh [email protected]"

aliaser delete '' Delete an existing alias eg: aliaser delete ssh43

For more options just type: aliaser -h, happy aliasing.

Popular Posts:

flattr this!

  One Response to “Aliaser take control of your alias on Linux”

  1. Cool tool!

 Leave a Reply

(required)

(required)


*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>