Skip to content
Advertisement

Return custom process command in Ubuntu

I want to launch the following script in bash

php mysript.php

and the “ps -A | grep php” command returns something if the script is running.

Is there any way to customize this “php” command with another name? I want to write

myphp myscript.php

and “ps -A | grep php” should return nothing, but “ps -A | grep myphp” should return something if the script is running.

I tried setting an alias for php command but still “ps” command returns “php” and not “myphp”

I also tried modifying the $PATH variable with a symbolic link from myphp to php in /usr/bin, but still returns “php”

Thanks

Advertisement

Answer

Just make a symlink to php binary:

ln -s /usr/bin/php /usr/bin/myphp

Now ps -A | grep myphp shows the running process.

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement