Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I wish to append & sign to the end of particular command (say tkdiff) whenenver I execute the command.

Please let me know what kind of alias / any other solution should I create in bashrc.

Thanks in advance.

Note: I may have few arguments to the command which i execute. & should come at the end so that I can execute in b/g and I can use the shell for any other purpose.

share|improve this question

You can't do this with a simple alias because the shell interprets the $@ when you define the alias. I would do this with a function in my .bashrc

tkdiff () { /usr/bin/tkdiff $@ & }
share|improve this answer
alias tkdiff='tkdiff &'

then source the .bashrc file to have it re-read and try again

edit: ok, I missed (or you added) the part about the extra arguments. You could try using $@ which is the variable holding the arguments list passed to the shell, but I have not tested this, sorry.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.