3/24/2011

Linux : Alias

Set Command Alias for commands often used.

1. Apply to all users.

root@debian:~# vi /etc/profile

# last line: add aliases
alias ll='ls $LS_OPTIONS -l'
alias l='ls $LS_OPTIONS -lA'
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'

root@debian:~# source /etc/profile # reload

2.Apply to a user

user@debian:~$ vi .bashrc

# last line: add aliases
alias ll='ls $LS_OPTIONS -l'
alias l='ls $LS_OPTIONS -lA'
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'

user@debian:~$ source .bashrc # reload