I can say apache2ctl graceful and my webserver restarts at an interactive shell. All is well. However, I need to say that in a shell script so I need the full path for apache2ctl. I have tried which and locate but nothing turns up which makes me very surprised. I looked in /usr/bin a开发者_如何学JAVAnd there is no apache2ctl. How do I figure out where this lives?
I thought maybe it would be in /opt/local/apache2/bin but there is an apachectl in there...not a apache2ctl. I'm stumped. Any ideas?
@Jon Lin - Nice work...type apache2ctl told me apache2ctl is aliased to
sudo /opt/local/apache2/bin/apachectl'` . Thank you very much.
It should be in /usr/sbin or /usr/local/sbin
You probably need to run updatedb
before locate
just in case
$ updatedb
# takes a while
$ locate apache2ctl
Or you can run find / -name 'apache2ctl' 2> /dev/null
to search for your entire partition
Did you try which
? (Not sure if that'd be present on a Mac, though it's pretty standard on most *nix systems; behaves rather like where
on windows).
精彩评论