Why is it that I have to type
/etc/init.d/apache2 (args) in order to run apache??
Isn't there a way to just
apache2 args ??
You don't normally type a command to run Apache: it starts when the system boots. Scripts in
If you've stopped Apache and want to restart it,
You should probably be using the
And the apache arguments should be in your
That is because /etc/init.d/ is not set in $PATH.
There are many ways to invoke a command (script or binary executable) that's not within the reach of your
Those methods are good to know - but, if you find yourself pulling all the more fancy stunts just to execute commands, then that would indicate a less than optimal system design.
Let's say this is your script, called
Three ways to still reach it, without giving the absolute path, are:
The first two, if you'd use them again, you'd put in your shell initialization file (