-1

I've seen several sudo commands that begin as so:

sudo -Hu apache

What is the purpose of the -Hu argument, and how does it pertain to the apache command that follows?

Gokhan
  • 111
  • 1
    (Nearly) all commands and programs come with an online manual, accessed with the [`man`](http://man7.org/linux/man-pages/man1/man.1.html) command, that document usage instructions and the available command line options. So please read the fine manual [`man sudo`](https://www.sudo.ws/man/1.8.18/sudo.man.html). – HBruijn Aug 13 '17 at 06:51

1 Answers1

3

sets $HOME to the apache user's home directory, and executes whatever would follow sudo -Hu apache as the apache user.

Ex: sudo -Hu apache ls ~ would execute ls ~ as the apache user with $HOME set to the apache user's home, listing apache's home directory contents

Ben M.
  • 171
  • 5