How to view processes, kill processes, start processes and other common commands in Linux

1. Check the process
    ps command to find the PID number related to the process:
    ps a Display all programs under the current terminal, including programs of other users.
    ps -A shows all programs.
    When ps c lists programs, display the actual command name of each program, without the path, parameter, or resident service designation.
    ps -e This parameter has the same effect as specifying the "A" parameter.
    ps e When listing programs, display the environment variables used by each program.
    ps f Use ASCII characters to display a tree structure, expressing the relationship between programs.
    ps -H Displays a tree-like structure, representing the interrelationships between programs.
    ps -N displays all programs, except the programs under the ps command terminal.
    ps s Displays program status in program signal format.
    ps S When listing programs, include interrupted subroutine data.
    ps -t <terminal number> Specifies the terminal number and lists the status of programs belonging to that terminal.
    ps u Displays program status in a user-focused format.
    ps x displays all programs, regardless of terminal.     The most common method is ps aux, and then use the grep command to filter through the pipeline to find a specific process, and then operate on the specific process.     ps aux | grep program_filter_word,ps -ef |grep tomcat ps -ef|grep java|grep -v grep Displays all java processes and removes the current grep process. 2. Kill the process
   




   

   Use the kill command to end the process: kill xxx
   Commonly used: kill -9 324
   Linux also provides a killall command, which can directly use the process name instead of the process identification number, for example: # killall -9 NAME

3. Enter the execution file of the process Under the path where it is located, execute the file ./filename

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326857853&siteId=291194637