1

I execute my jobs in terminal using:

mpirun -np 4 lmp_fedora < in.stdinfile

Now I want to create a permanent alias run so that I can just input the command:

run < in.stdinfile 

from any directory in the terminal to execute my jobs. What is the syntax for the alias or the environment variable?

kos
  • 35,891

1 Answers1

1

In this case the alias would be:

alias run='mpirun -np 4 lmp_fedora'

The canonical way to add an user-defined local alias is to put it into ~/.bashrc; you can directly add it to ~/.bashrc using this command, which will append it to the end of the file:

echo "alias run='mpirun -np 4 lmp_fedora'" >> ~/.bashrc

Then you can run source ~/.bashrc to apply the changes in your current bash instance:

source ~/.bashrc
kos
  • 35,891
  • @TheoScore I'm glad to have helped you. Since you're a new user, please consider accepting, for each of your question (i.e. this one also), the answer that helped you the most; this is a way to highlight which answer worked for you (for future visitors) and to thank the answerer, giving him 15 points of reputation (you'll also get 2 points of reputation from each acceptance) [cont] – kos Jul 07 '15 at 03:10
  • [cont] Furthermore, when you'll have more reputation (I think 15 it's enough), consider also upvoting such accepted answers, along with all the other helpful answers you received to your questions; that's how you indicate that you deem that such answers were useful (in this case to pursue your scope). – kos Jul 07 '15 at 03:11