faqts : Computers : Operating Systems : Linux

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

111 of 124 people (90%) answered Yes
Recently 9 of 10 people (90%) answered Yes

Entry

Linux: Alias: Operation: Create: How to define an alias? [alias]
How do I create an alias that passes a word to a command? I want to create the alias spl and type '

Feb 23rd, 2004 05:58
Knud van Eeden, Dick C,


----------------------------------------------------------------------
--- Knud van Eeden --- 18 September 2003 - 09:21 pm ------------------

Linux: Alias: Operation: Create: How to define an alias?

---

Open a console, and type the command:

 alias <your new name>=<your commands>

---

e.g.

alias attrib='chmod'

alias cd..='cd ..'

alias chkdsk='df'

alias cls='clear'

alias cls=clear

alias copy='cp'

alias copy=cp

alias d='ls -a'

alias del='rm'

alias dir..='dir ..'

alias dir='ls -lsa'

alias dir=ls -a

alias dira='ls mnt/floppy'

alias list=cat

alias md='mkdir'

alias mountfloppy='mount -t vfat /dev/fd0 /mnt/floppy'

alias move='mv'

alias prn='lpr'

alias q='emacs'

alias qa='q /etc/bashrc'

alias rd='rmdir'

alias ren='mv'

alias s='ftp </home/myftp'

alias type=cat

alias unmount='umount'

---

does not work: alias a='/mnt/floppy'

does not work: alias autoexec.bat='/etc/bashrc'

---

You can also change the defaults action of already existing commands,
e.g.

alias ls='ls -AF'

---

To get more information, type the command:

 man alias

---
---

Internet: see also:

---

Linux: Alias: Operation: Delete: How to delete an alias?
http://www.faqts.com/knowledge_base/view.phtml/aid/24561/fid/107

---

Linux: Alias: Operation: View: All: How to see all currently defined 
aliases?
http://www.faqts.com/knowledge_base/view.phtml/aid/24557/fid/107

---

Linux: Alias: Operation: Store: File: In which file to permanently 
store aliases?
http://www.faqts.com/knowledge_base/view.phtml/aid/24565

---

Operating system: Linux: What is the command line separator in Linux? 
[; / alias]
http://www.faqts.com/knowledge_base/view.phtml/aid/26760/fid/457

----------------------------------------------------------------------