1, the meaning of the process
The so-called process is a task in AIX, and a running program is a process.
2, child processes and parent processes
Processes and processes can have dependencies, a process can produce new processes, and the resulting processes are called child processes, and the original process is called the parent process.
3, view the process
PS: Process View command
You can view the UID (user ID) of the process in the PS command, PID (process id), PPID (parent process ID), C (CPU utilization), stime (Start time), TTY (console), Time (run), CMD (command), and so on.
$ ps-f
UID PID PPID C stime ttytime CMD
Xumin 15044 26436 0 17:17:15 pts/1 0:00-ksh
Xumin 27412 15044 6 17:18:04 pts/1 0:00ps-f
4. Foreground process and background process
(1) Foreground process
When the foreground process is running, the user must wait for the current process to finish before running the next process.
How the foreground process works:
$ command
(2) Background process
When the background process is running, the user does not have to wait for the end of the current background process to run the next process.
How the background process works:
$ Command &
5, improve the process priority level
(1) Nice: can increase the value of nice, reduce the priority level of the process.
$ nice [-lncrement |-n lncrement]
(2) Renice: The value of nice can be added again to reduce the priority of the process.
6. Terminate the process
(1) Foreground process
Ctrl-c: Terminating the current foreground process
Kill: Terminate the specified foreground process
(2) Background process
Kill: Terminate the specified background process
(3) Use of Kill
$ kill [-signalnumber |-signalname] Processes
Common:
$ kill Processesid
$ kill-9 Processesid
Processesid is the process number and can be obtained using the PS command
7. Running Long process
Nohup: The user's background process is still running when users exit the system, and the output information without the specified nohup will be saved in Nohup.out
$ nohup Command &
$ nohup ls-r/&
8, the shell environment of the process Control
<ctrl-z>: Suspend foreground process
Jobs: Show background processes and paused processes
FG: The process of continuing to be suspended
BG: Continue the process that is paused and run it in the background
Specify a process in BG, FG, kill and use%jobnumber,jobnumber to get
9, the background resident program Deamons
Deamon is a never-ending process that is often used to manage and control system resources such as Qdeamon (print Management), cron (timed to run specified programs), Errdeamon (Error Management), and so on.
See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/OS/unix/
10. Show/Modify Process properties
The properties of a process consist primarily of the ID number of the process, the ID number of the parent process, the elapsed time, the program name and priority of the execution, and so on.
11. Show Process Properties
To display the properties of a process you can use the PS command, and AIX supports all at&t and BSD-style PS commands.
To use BSD style, simply remove the minus sign of the command option, for example:
# PS ALX
The at&t version of the above command is:
# ps-elf
In the PS command output, the PRI and NI values represent the priority level of the process. Nice is part of the calculation of the priorities value, and the range of priorities values is 0~ 127. The lower the value, the more frequently the process is scheduled to execute, and the higher the value means the lower the priority.
12. Modify Process Priority
To change the priority of a process, you can use the Nice command. The nice command can be followed by 0~ 39, and the higher the value means the lower the priority. There are two forms of Nice command syntax: nice–increment (increment) and Nice-n Increment (increment). When negative values must be used, the latter can be used. If you do not specify a value, nice defaults to an increase of 10. The following command adds a 10 priority to a command.
# nice-10 CommandName (command name)
The following command reduces the priority of 10 for a command
# nice CommandName
The Renice command also provides the-n option. The syntax of Renice is:
# Renice Priority-p PID
If no additional options are specified, then-p may not.
13. Stop the process
AIX uses the KILL command to stop the process. AIX has two kinds of KILL commands:/usr/bin/kill and shell-built command kill. The two commands can use a different number of semaphores. The semaphore is used to inform the process of performing the appropriate action. For example: The TERM signal is to force the process to exit, and HUP is to force the process to suspend. You can use Kill-l to display the amount of semaphores available.
# kill–l
AIX also has killall commands that any user can use to run all processes except those that are sent out of the process.
Syntax is:
# killall–signal
14, Performance testing
The purpose of the management process is to improve the performance of the system, so first we need to test the performance of the system and analyze the bottleneck of the system performance. AIX supports standard UNIX commands such as Topas, SAR, Vmstat, and Iostat.
Topas
Dynamic Refresh displays system performance information, including the top-level process of the system, the system state (average burden), the amount of memory used and freed, and the individual process state that is activated on the system. In contrast to the PS command, the PS command only gives a "snapshot" of the system at a given time, while the TOPAS displays system information and their changes at certain intervals.
Sar
Displays cumulative system activity information, including CPU utilization, buffer activity, data read and read from device, terminal activity, number of specific system calls being used, number of exchanges, queue length, and additional core information.
Vmstat
Quantify the amount of virtual storage used by system processes, and also displays traps and CPU activity information.
Iostat
Statistics of HDD, terminal, processor I/O situation.
15, the process of timing start
You can use a cron waiting process to start a process on a scheduled basis, which uses the crontab file in the/var/spool/cron/crontabs directory with the user name as the filename, such as root crontab file. AIX supports at&t style crontab files, each containing the following format:
Minutes (0 to 59)
Hours (0 to 23)
Days of the month (1 to 31)
One year (1 to 12)
Days of the week (0 to 6, entire Saturday to Sunday)
Shell command
Aix can also invoke the crontab command directly. The crontab command has the-e option, which loads the contents of the crontab into the editing environment. Which editor to use depends on the value of the EDITOR variable. Once saved and exited from the editing environment, the new crontab file is changed and comes into effect quickly.
Under normal circumstances, the Crontab spool directory is defined in/var/spool/cron. In addition AIX has a connection from/usr/spool to/var/spool, which is the operating system in order to remain compatible with previous versions.
Author Information: 51cto Blog Oracle Little Bastard