You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: topics/linux/README.md
+18-1Lines changed: 18 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1060,7 +1060,7 @@ sar -n TCP,ETCP 1
1060
1060
<details>
1061
1061
<summary>how to list all the processes running in your system?</summary><br><b>
1062
1062
1063
-
`ps -ef`
1063
+
The "ps" command can be used to list all the processes running in a system. The "ps aux" command provides a detailed list of all the processes, including the ones running in the background.
1064
1064
</b></details>
1065
1065
1066
1066
<details>
@@ -1103,22 +1103,28 @@ To view all available signals run `kill -l`
"kill -0" checks if a process with a given process ID exists or not. It does not actually send any signal to the process.
1110
1112
</b></details>
1111
1113
1112
1114
<details>
1113
1115
<summary>What is a trap?</summary><br><b>
1116
+
A trap is a mechanism that allows the shell to intercept signals sent to a process and perform a specific action, such as handling errors or cleaning up resources before terminating the process.
1117
+
1114
1118
</b></details>
1115
1119
1116
1120
<details>
1117
1121
<summary>Every couple of days, a certain process stops running. How can you look into why it's happening?</summary><br><b>
1122
+
One way to investigate why a process stops running is to check the system logs, such as the messages in /var/log/messages or journalctl. Additionally, checking the process's resource usage and system load may provide clues as to what caused the process to stop
1118
1123
</b></details>
1119
1124
1120
1125
<details>
1121
1126
<summary>What happens when you press ctrl + c?</summary><br><b>
1127
+
When you press "Ctrl+C," it sends the SIGINT signal to the foreground process, asking it to terminate gracefully.
1122
1128
</b></details>
1123
1129
1124
1130
<details>
@@ -1142,6 +1148,7 @@ Zombie (z)
1142
1148
1143
1149
<details>
1144
1150
<summary>How do you kill a process in D state?</summary><br><b>
1151
+
A process in D state (also known as "uninterruptible sleep") cannot be killed using the "kill" command. The only way to terminate it is to reboot the system.
1145
1152
</b></details>
1146
1153
1147
1154
<details>
@@ -1184,14 +1191,24 @@ It is the first process executed by the kernel during the booting of a system. I
1184
1191
1185
1192
<details>
1186
1193
<summary>How to change the priority of a process? Why would you want to do that?</summary><br><b>
1194
+
To change the priority of a process, you can use the nice command in Linux. The nice command allows you to specify the priority of a process by assigning a priority value ranging from -20 to 19. A higher value of priority means lower priority for the process, and vice versa.
1195
+
1196
+
You may want to change the priority of a process to adjust the amount of CPU time it is allocated by the system scheduler. For example, if you have a CPU-intensive process running on your system that is slowing down other processes, you can lower its priority to give more CPU time to other processes.
1187
1197
</b></details>
1188
1198
1189
1199
<details>
1190
1200
<summary>Can you explain how network process/connection is established and how it's terminated?></summary><br></b>
1201
+
When a client process on one system wants to establish a connection with a server process on another system, it first creates a socket using the socket system call. The client then calls the connect system call, passing the address of the server as an argument. This causes a three-way handshake to occur between the client and server, where the two systems exchange information to establish a connection.
1202
+
1203
+
Once the connection is established, the client and server can exchange data using the read and write system calls. When the connection is no longer needed, the client or server can terminate the connection by calling the close system call on the socket.
1191
1204
</b></details>
1192
1205
1193
1206
<details>
1194
1207
<summary>What <code>strace</code> does? What about <code>ltrace</code>?</summary><br><b>
1208
+
Strace is a debugging tool that is used to monitor the system calls made by a process. It allows you to trace the execution of a process and see the system calls it makes, as well as the signals it receives. This can be useful for diagnosing issues with a process, such as identifying why it is hanging or crashing.
1209
+
1210
+
Ltrace, on the other hand, is a similar tool that is used to trace the library calls made by a process. It allows you to see the function calls made by a process to shared libraries, as well as the arguments passed to those functions. This can be useful for diagnosing issues with a process that involve library calls, such as identifying why a particular library is causing a problem.
0 commit comments