3 Replies - 533 Views - Last Post: 10 January 2017 - 07:00 AM

#1 wtp  Icon User is offline

  • D.I.C Regular

Reputation: 26
  • View blog
  • Posts: 319
  • Joined: 08-December 11

How do I rename a command?

Posted 09 January 2017 - 09:51 PM

I want to be able to run emacs with just e
Is This A Good Question/Topic? 0
  • +

Replies To: How do I rename a command?

#2 jon.kiparsky  Icon User is offline

  • Screw Trump (before he screws you)
  • member icon


Reputation: 10625
  • View blog
  • Posts: 18,185
  • Joined: 19-March 11

Re: How do I rename a command?

Posted 09 January 2017 - 09:56 PM

One way would be to just make an alias:

alias e='emacs'


for this to be persistent, you'd want to list it in your aliases file. The name of this file is dependent on local configuration, but it might be .aliases or .bash_aliases

Or you could be clever and make a soft link from somewhere on your $PATH to wherever you've got your emacs:

[[email protected]/~/tmp: Mon Jan 09 23:52]:553 $ which emacs
/usr/local/bin/emacs
[[email protected]/~/tmp: Mon Jan 09 23:54]:554 $ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/texbin:/Users/jpk/bin:/Users/jpk/anaconda/bin:/Users/jpk/.rvm/bin
[[email protected]/~/tmp: Mon Jan 09 23:54]:556 $ ln -s /usr/local/bin/emacs /Users/jpk/bin/e 
[[email protected]/~/tmp: Mon Jan 09 23:54]:557 $ e


You could rename the file:

Quote

[[email protected]/~/tmp: Mon Jan 09 23:52]:553 $ mv /usr/local/bin/emacs /usr/local/bin/e


but I would strongly recommend that you not do that.
Was This Post Helpful? 3
  • +
  • -

#3 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 13400
  • View blog
  • Posts: 53,480
  • Joined: 12-June 08

Re: How do I rename a command?

Posted 09 January 2017 - 09:56 PM

I would figure you would make a bash script or monkey with the bash_aliases file.
Was This Post Helpful? 1
  • +
  • -

#4 no2pencil  Icon User is offline

  • Professor Snuggly Pants
  • member icon

Reputation: 6544
  • View blog
  • Posts: 30,651
  • Joined: 10-May 07

Re: How do I rename a command?

Posted 10 January 2017 - 07:00 AM

jon.kiparsky literally covered everything on the topic.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1