This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Linux / UNIX and the fly likes Linux shortcut commands Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "Linux shortcut commands" Watch "Linux shortcut commands" New topic
Author

Linux shortcut commands

Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9345
    
    2

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?


SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60800
    
  65

Why cd at all? Just type the full path to the shell script. Or put its folder on the PATH.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9345
    
    2

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

Joined: Jan 10, 2002
Posts: 60800
    
  65

Use the PATH, Luke
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9345
    
    2

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

Joined: Oct 21, 2004
Posts: 801

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 &'


Regards Pete
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Linux shortcut commands
 
Similar Threads
Jboss not Running/starting
shell script in eclipse to allow redirection of files via standard in
setting Linux Java environment
Shell program locking up CD Drive
CD Auto Run in Linux