java - Doubts with command: pkill -INT -f '^php test_program.php$' -


question: each element of command:

pkill -int -f '^php test_program.php$' 

do when run in linux terminal? know command kills process called test_program.php, don't know different elements of command doing. please explain in simple terminology possible! new linux commands , prefer baby lingo tech lingo @ moment :)


my research: running man pkill in linux terminal, manual appears following pkill definition:

  • signal processs based on name or other attributes.

which leads me believe pkill doesn't kill process, rather can send lot of different signals, 1 of might kill process. structure/synopsis of pkill command displayed as: pkill [option] pattern

from list of options in same manual, -f, -full had following definition:

  • the pattern matched against process name. when -f set, full command line used.

i didn't understand meant. also, there -int before -f in command, leads me believe more 1 option can joined together, -int not displayed in manual.

the other parts of command seem identifying program running: '^php test_program.php$', why isn't part of command 'test_program.php'? ^php @ beginning , $ , end do?

you looking @ regular expression. expression looks string test_program.php anywhere in process name. if process name like

/var/php -runcommand test_program.php 

it find process , kill it.

this explains -f, -full option. not using regular expression, have take full process name (the preceeding line) match process.

finally, -int used send runlevel task.

edit

i wrong, -int option not used runlevels (which linux kernel) send signals task. term (terminate), stop (shut down) or cont (continue process). pkill sends default terminate signal process.

the /var/php -runcommand test_program.php example process. if use command ps ax, list of processes , programs execute them. assumed php interpreter resides in /var/php/ , execution of php file command.


Comments

Popular posts from this blog

scala - 'wrong top statement declaration' when using slick in IntelliJ -

c# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

PySide and Qt Properties: Connecting signals from Python to QML -