Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Linux shortcut commands

 
Joe Harry
Ranch Hand
Posts: 10091
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guys,

I have a couple of programs that I start using the terminal. But everytime when I open the terminal, I had to kind of cd into the directory where the shell script resides and then start it. Is there a shortcut command that I can use which would cd into the directory and start the program for me? I guess I have to write my own shell script for this or is there any Linux command that can do this for me?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64631
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why cd at all? Just type the full path to the shell script. Or put its folder on the PATH.
 
Joe Harry
Ranch Hand
Posts: 10091
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:Why cd at all? Just type the full path to the shell script. Or put its folder on the PATH.


That typing is what I want to avoid and make it elegant by having a couple of shell scrips that would do that for me. What I would like to know is if there is a Linux command that I can create for such shortcuts?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64631
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use the PATH, Luke
 
Joe Harry
Ranch Hand
Posts: 10091
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good idea. I however do not want those additional programs to be in my PATH. I'm going to create a couple of shell scripts to do this for me.

Thanks for your suggestions!
 
Peter Rooke
Ranch Hand
Posts: 847
1
Java Linux Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The alias command should help. You can set these up in your startup scripts. For the bash shell, edit your .bash_profile in the home directory.

To setup an alias called startadmin:

alias startadmin='nohup /bea/domains/domain_name_x/bin/startWebLogic.sh >/bea/domains/domain_name_x/servers/domain_admin/logs/domain_admin_startup.log 2>&1 &'

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic