Categories
Uncategorized

Ubuntu bash aliasing or how to save time typing in the command line terminal

In Linux you can edit the bash config file to add aliases for your most used commands in order to save time typing them.

I use Ubunto as a desktop machine and Debian as a server. In these distributions the bash files you can edit to add your cmmands’ aliases are .bashrc or .bash_profile.

$ sudo nano /etc/bash.bashrc

For example, the first commands in my list of aliases are ‘ls -l’ and ‘sudo apt-get update’. So, at the end of the .bashrc file I type:

#my aliases
alias  ll=’ls -l’
alias aptu=’sudo apt-get update’

Save the file (CTRL+O in nano) and close it (CTRL+X in nano). Restart bash to apply the new aliases by typng ‘bash’ in the command prompt:

$ bash

And there you go 🙂 Type ‘ll’ to test the new alias:

$ ll

Enjoy 🙂

Update: my favorite bash aliases so far:

alias aptu=’sudo apt-get update’

alias sn=’sudo nano’

alias ar=’sudo /etc/init.d/apache2 restart’

alias snbash=’sudo nano /etc/bash.bashrc’

Categories
Uncategorized

Syntax highlighter plugin for WordPress

http://wordpress.org/extend/plugins/syntaxhighlighter/installation/