I prefer command line to anything else whenever it's possible. So I usually work in terminal. There is a capability in bash which enables you to define aliases for commands in order to make them easier to run or just as a matter of convenience. For instance you might want to have untgz as an alias for "tar xvfz" and simply type untgz foo.tar.gz to uncompress it. Or you might need to make the "rm" command safer by aliasing it to "rm -i" to ask you if it should be really removed in order to save you from horrible mistakes.
First of all open a terminal and type
near the end of the file uncomment and change these lines:
Code:
# Define your own aliases here ...
#if [ -f ~/.bash_aliases ]; then
# . ~/.bash_aliases
#fi
to:
Code:
# Define your own aliases here ...
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi
save and close the file. Now you can define your own aliases in a file named ".bash_aliases" (note the dot before the name please) in your home directory. Mine as a sample looks like this:
Code:
# For safety
alias cp='cp -i'
alias ln='ln -s'
alias mv='mv -i'
alias rm='rm -i'
# convenience redefinitions
alias ..='cd ..'
alias ...='cd ...'
alias cd..='cd ..'
alias cd-='cd -'
alias ls='ls -lh --color=auto'
alias dir='ls -lh --color=auto'
alias df="df -h"
alias h=history
alias untgz="tar -xvfz"
alias untbz2="tar -xvfj"
alias netstati="netstat --verbose --tcp --udp --programs --extend"
# inventions!
alias aptsource='sudo gedit /etc/apt/sources.list'
alias penning='ssh -L 5902:localhost:5902 myusername@myhost'
alias wireless='sudo iwconfig eth1 essid belkin54g; sudo dhclient eth1'
I hope that some people would join me and contribute by adding their own aliases
Bookmarks