Search Suggest

How to create alias command in linux

Type command  to show some alias 
# alias

alias cp='cp -i'
alias l.='ls -d .* --color=auto'

Create ls command alias
#ls
@                     body_checks                    email                             mem.sh

Syntax:
# alias aliasname=`command`
Ex:
# alias list=`ls`

now test ls command alias as list
#list

Unalias command
# unalias aliasname
# unalias list

How to permanently/manually save alias
Alias file location: /root/.bashrc

#vim /root/.bashrc
alias list=`ls`

Update file
#  source ~/.bashrc
or,
# source /root/.bashrc

Đăng nhận xét