QUESTION: What does each element of the command:
pkill -INT -f '^php test_program.php$'
do when I run it in the linux terminal? I already know that the command kills the process called test_program.php, but I don't know what all the different elements of the command are doing. Please explain in as simple terminology as possible! I am new to linux commands and I prefer baby lingo to tech lingo at the moment :)
MY RESEARCH: By running man pkill
in the linux terminal, a manual appears with the following pkill
definition:
- signal processs based on their name or other attributes.
which leads me to believe that pkill
doesn't only kill a process, but rather can send a lot of different signals, one of which might kill the process. The structure/synopsis of the pkill
command was displayed as: pkill [option] pattern
From the list of options in the same manual, -f, -full
had the following definition:
- The pattern is normally only matched against the process name. When -f is set, the full command line is used.
I didn't completely understand what that meant. Also, there is a -INT
before the -f
in the command, so that leads me to believe that more than one option can be joined together, however -INT
was not displayed in the manual.
The other parts of the command seem to be identifying the program that is running: '^php test_program.php$'
, but why isn't that part of the command just 'test_program.php'
? What does ^php
at the beginning and $
and the end do?