Difference between ./ and & to run a script
Hi, i installed vmware tools on my mint OS. i noticed i could run vmware-toolbox with either ./vmware-toolbox and vmware-toobox &
Is there any difference between these two? Thanks! |
Those two are totally unrelated. ./ before a script name tells your shell to look into the current directory, which is on Linux systems (opposite to Windows) not in the PATH. The ampersand (&) tells the shell to run a program in the background. Both commands have totally different uses and are not related.
|
Well apart from ./ means your running the one in the current directory and without it you are running the one in your PATH, which may or may not include the current directory, and the & is telling the
shell to run the command in the background ... I would have to say ./ and & have very little in common |
What they said ^ :)
Also, if you are researching this, you should also lookup the nohup cmd .. ;) |
Welcome to Linux Questions! :)
The most noticeable thing you will find regarding the two ways of running the command is that Code:
./<executable file> Code:
<executable file> & I thought you might like a slightly less-technical reply. :) Play Bonny! :hattip: |
All times are GMT -5. The time now is 06:21 PM. |