rianto isaac's Weblog

rianto utomo isaac sahala utomo

linux, make alias

leave a comment »

alias command

The alias command can be useful if you want to create a ‘shortcut’ to a command.
The format is alias name=’command’

> alias home=’cd /home/dave/public_html’

This will create an alias called home which will put you in the /home/dave/public_html directory whenever you type home at the command prompt. You can alias any command you want, and include options for the command.

> alias list=’ls -la’

This will create an alias called list, which will use the ls command to print a long-style listing of all files in the current directory (the -l gives a long-style list, and the -a shows all files – including hidden files).
(Find out more about the ls command)

To see a list of aliases set up on your linux box, just type alias at the prompt.

> alias
alias attrib=’chmod’
alias chdir=’cd’
alias copy=’cp’
alias cp=’cp -i’
alias d=’dir’
alias del=’rm’
alias deltree=’rm -r’
alias dir=’/bin/ls $LS_OPTIONS –format=vertical’
alias edit=’pico’
alias ff=’whereis’
alias ls=’/bin/ls $LS_OPTIONS’
alias mem=’top’
alias move=’mv’
alias mv=’mv -i’
alias pico=’pico -w -z’
alias rm=’rm -i’
alias search=’grep’
alias v=’vdir’
alias vdir=’/bin/ls $LS_OPTIONS –format=long’
alias which=’type -path’
alias wtf=’watch -n 1 w -hs’
alias wth=’ps -uxa | more’
>

You can see there are a few already set up on a default Redhat 9 installation.

To remove an alias, use the unalias command.

rianto utomo bole nyontek dari http://www.mediacollege.com/linux/command/alias.html

Written by isaaconi

Oktober 15, 2009 pada 4:15 pm

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

%d blogger menyukai ini: