Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 07-14-2007, 04:20 PM   #1
Senior Member
Registered: May 2004
Location: Orlando, FL
Distribution: Arch
Posts: 2,905

Rep: Reputation: 77
Creating Command Alias?

I would like to create a simple alias for vpnc to just be vpn. Yes, I know the alias is simply the exclusion of one simple letter or key stroke but it is just a test as I have never done this before.

I did a search and there seems to be no man page on this on my system which led me to Google results and they did not work on my system.

tunafish:/home/cwilliams/Desktop# alias -p vpnc=vpn
alias cp='cp -i'
alias l='ls $LS_OPTIONS -lA'
alias ll='ls $LS_OPTIONS -l'
alias ls='ls $LS_OPTIONS'
alias mv='mv -i'
alias rm='rm -i'
What am I doing wrong?
Old 07-14-2007, 04:33 PM   #2
LQ Veteran
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
Where did you get the "-p" switch?

On my machine, this works:

alias l=ls

And there is also "unalias"

Also no man page for either--I did get some info by typing "alias --help" and "unalias --help"
root@1[play]# alias --help
bash: alias: --: invalid option
alias: usage: alias [-p] [name[=value] ... ]
root@1[play]# unalias --help
bash: unalias: --: invalid option
unalias: usage: unalias [-a] name [name ...]
Still don't know what the switches do, but I'm guessing that "unalias -a" means delete all aliases. (I'm not going to try it--too lazy to recreate them all)
Old 07-14-2007, 04:41 PM   #3
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
man bash
/^ *alias

Old 07-14-2007, 06:32 PM   #4
Senior Member
Registered: May 2004
Location: Orlando, FL
Distribution: Arch
Posts: 2,905

Original Poster
Rep: Reputation: 77
Yes - unalias -a removes everything listed when you run the command "alias". I just tested it however I had some generic ssh and ls aliases I simply created on the fly.

Thanks all!


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help creating an Alias that will mount floppy mral Linux - Newbie 8 12-24-2005 07:47 AM
Need advice on creating an alias thorney Linux - General 2 11-27-2005 08:33 PM
Creating an alias (name=value pair) where the name has spaces. Cubert Linux - Newbie 2 01-12-2005 07:42 AM
Creating mult command alias in BASH labob Linux - Newbie 1 11-18-2004 08:37 PM
problem creating an alias to mount a drive j_l_ajaste Linux - Newbie 6 07-01-2003 11:41 PM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:56 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration