Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
| elearning:workbooks:redhat:rh124en:l109 [2024/11/12 10:05] – admin | elearning:workbooks:redhat:rh124en:l109 [2024/11/27 08:50] (Version actuelle) – admin | ||
|---|---|---|---|
| Ligne 39: | Ligne 39: | ||
| * A list of open files.. | * A list of open files.. | ||
| - | This information is stored in the **/proc** directory. The /proc directory contains virtual files and directories. The contents of these files are created dynamically during consultation. Only root can view all the information in the /proc directory. | + | This information is stored in the **/proc** directory: |
| - | + | ||
| - | Enter the following command: | + | |
| < | < | ||
| Ligne 115: | Ligne 113: | ||
| </ | </ | ||
| - | <WRAP center round important> | + | <WRAP center round important |
| **Important** - Note that the content of the files is of little or of no direct use to a System Administrator. | **Important** - Note that the content of the files is of little or of no direct use to a System Administrator. | ||
| </ | </ | ||
| Ligne 127: | Ligne 125: | ||
| * **daemon** - processes that do not have a parent terminal. | * **daemon** - processes that do not have a parent terminal. | ||
| - | A process can be in one of nine states or //process states// : | + | A process can be in one of nine //process states// : |
| * //user mode// - the process is executing in user mode, | * //user mode// - the process is executing in user mode, | ||
| Ligne 143: | Ligne 141: | ||
| ====1.1 - The ps command==== | ====1.1 - The ps command==== | ||
| - | This command | + | The output from this command |
| < | < | ||
| Ligne 155: | Ligne 153: | ||
| </ | </ | ||
| - | For more details, use the **-l** | + | You can get more details |
| < | < | ||
| Ligne 183: | Ligne 181: | ||
| - | To view the process table, use the ps command with the l and x options - the command displays all the processes with a long display | + | To view the process table, use the ps command with the l and x switches: |
| < | < | ||
| Ligne 252: | Ligne 250: | ||
| ^ STAT | The same thing as S in the previous example | ^ STAT | The same thing as S in the previous example | ||
| - | + | Using the a, u and x switches you obtain | |
| - | With options | + | |
| < | < | ||
| Ligne 528: | Ligne 525: | ||
| ====1.3 - The pstree command==== | ====1.3 - The pstree command==== | ||
| - | This command displays processes in a tree structure, showing parent processes as children: | + | This command displays processes in a tree structure: |
| < | < | ||
| Ligne 646: | Ligne 643: | ||
| ====1.4 - The top command==== | ====1.4 - The top command==== | ||
| - | This command | + | **top** |
| < | < | ||
| Ligne 709: | Ligne 706: | ||
| ... | ... | ||
| </ | </ | ||
| + | |||
| To display the **top** command help, press **h** : | To display the **top** command help, press **h** : | ||
| Ligne 738: | Ligne 736: | ||
| </ | </ | ||
| - | <WRAP center round important> | + | <WRAP center round important |
| - | **Important** - To return to the previous display, press **q** or **echap**. | + | **Important** - To return to the previous display, press **q** or **escape**. |
| </ | </ | ||
| - | At launch, the list refresh | + | When launched top' |
| < | < | ||
| Ligne 817: | Ligne 815: | ||
| </ | </ | ||
| - | If you do not want to see zombie | + | To see the zombie |
| < | < | ||
| Ligne 845: | Ligne 843: | ||
| ====1.5 - The fg, bg and jobs commands==== | ====1.5 - The fg, bg and jobs commands==== | ||
| - | Normally | + | Normally commands |
| < | < | ||
| Ligne 851: | Ligne 849: | ||
| </ | </ | ||
| - | <WRAP center round important> | + | <WRAP center round important |
| - | **Important** - Note that a background process is said to be **asynchronous** because it continues independently of its parent, which is the shell. | + | **Important** - Note that a background process is said to be **asynchronous** because it continues independently of its parent, which is the shell. |
| </ | </ | ||
| - | Linux numbers all processes | + | Linux identifies |
| - | The **jobs** command | + | The **jobs** command |
| < | < | ||
| Ligne 867: | Ligne 865: | ||
| </ | </ | ||
| - | <WRAP center round important> | + | <WRAP center round important |
| - | **Important** - Note that the job number is enclosed in [square brackets] whereas | + | **Important** - The job number is between |
| </ | </ | ||
| If you wish to send a process into the background to free up the shell for other commands, you must first suspend the process in question. Normally we suspend a process using the key combination < | If you wish to send a process into the background to free up the shell for other commands, you must first suspend the process in question. Normally we suspend a process using the key combination < | ||
| - | For example, press : | + | For example: |
| < | < | ||
| Ligne 881: | Ligne 879: | ||
| </ | </ | ||
| - | Once suspended, use the command | + | Once suspended, use the **bg** (background) |
| < | < | ||
| Ligne 892: | Ligne 890: | ||
| </ | </ | ||
| - | <WRAP center round important> | + | <WRAP center round important |
| - | **Important** - Note that when the process | + | **Important** - Note that when the process |
| </ | </ | ||
| - | To bring the process | + | To bring the job back to the foreground |
| < | < | ||
| Ligne 912: | Ligne 910: | ||
| </ | </ | ||
| - | <WRAP center round important> | + | <WRAP center round important |
| - | **Important** - Note the use of < | + | **Important** - Note that we have used the < |
| </ | </ | ||
| Ligne 945: | Ligne 943: | ||
| ====1.6 - The wait command==== | ====1.6 - The wait command==== | ||
| - | This command | + | The **wait** |
| < | < | ||
| Ligne 958: | Ligne 956: | ||
| </ | </ | ||
| - | <WRAP center round important> | + | <WRAP center round important |
| **Important** - Note that using < | **Important** - Note that using < | ||
| </ | </ | ||
| Ligne 964: | Ligne 962: | ||
| ====1.7 - The nice command==== | ====1.7 - The nice command==== | ||
| - | This command | + | This command |
| < | < | ||
| Ligne 987: | Ligne 985: | ||
| </ | </ | ||
| - | As you can see, the 6th column contains the nice value which applies | + | As you can see the 6th column contains the nice value that is applied |
| - | <WRAP center round important> | + | <WRAP center round important |
| - | **Important** - Note that only root can start processes with a negative | + | **Important** - Note that only root can give a process |
| </ | </ | ||
| Ligne 1018: | Ligne 1016: | ||
| ====1.8 - The renice command==== | ====1.8 - The renice command==== | ||
| - | This command | + | This command |
| < | < | ||
| Ligne 1050: | Ligne 1048: | ||
| </ | </ | ||
| - | <WRAP center round important> | + | <WRAP center round important |
| - | **Important** -Note that only root can decrement | + | **Important** -Note that only root can decrease |
| </ | </ | ||
| Ligne 1080: | Ligne 1078: | ||
| ====1.9 - The nohup command==== | ====1.9 - The nohup command==== | ||
| - | This command allows a process to continue | + | This command allows a process to continue after closing the terminal in which is was launched. A child process dies when the parent process dies or terminates. As a connection is a process, when you disconnect, your processes terminate. To avoid remaining connected after launching a long process, use the nohup command: |
| < | < | ||
| Ligne 1112: | Ligne 1110: | ||
| </ | </ | ||
| - | ====.10 - The kill==== | + | ====1.10 - The kill command==== |
| The kill command sends signals to processes. The list of possible signals can be displayed using the **-l** option: | The kill command sends signals to processes. The list of possible signals can be displayed using the **-l** option: | ||
| Ligne 1133: | Ligne 1131: | ||
| </ | </ | ||
| - | < | + | < |
| **Important** - You will notice that each signal has a number. These signal numbers are used instead of options. For example, **-19** instead of the **-stop** option. | **Important** - You will notice that each signal has a number. These signal numbers are used instead of options. For example, **-19** instead of the **-stop** option. | ||
| </ | </ | ||
| - | Some of the most useful signal numbers | + | The most usefull signals |
| - | ^ Number | + | ^ Numéro |
| - | | -1 | The Hang Up signal | + | | -1 | A Hang Up is sent to all the child processus |
| - | | -2 | Process interrupt - equivalent | + | | -2 | Equivalent |
| - | | -3 | The same as -2 but with the generation of a debug file | | + | | -3 | The same signal |
| - | | -9 | The signal that kills a process | + | | -9 | A brutal way of killing |
| - | | -15 | The signal sent by default by the **kill** command. Process terminates normally | + | | -15 | The correct way of killing a process |
| The command line switches for this command are : | The command line switches for this command are : | ||