Unix (LINUX) Commands
Commands for Process Management
| Command |
Role |
Example |
| ps | Displays currently running processes in the terminal. | ps |
| ps -ef | Displays all running processes with detailed information. | ps -ef |
| ps aux | Displays all processes, including those of other users. | ps aux |
| ps aux | more | Displays processes page by page. | ps aux | more |
| top | Displays processes in real time with dynamic updates. | top |
| jobs | Displays background and suspended jobs in the current shell. | jobs |
| fg | Brings a suspended or background job to the foreground. | fg %1 |
| bg | Resumes a suspended job in the background. | bg %1 |
| kill | Sends a signal to a process, usually to stop it. | kill 1234 |
| kill -9 | Forces termination of an unresponsive process. | kill -9 1234 |
| & | Runs a command in the background. | ./my_program & |
| nohup | Continues execution after logout. | nohup ./my_program & |
| kill -l | Displays available system signals. | kill -l |
C Libraries
| Library | Role |
| <sys/types.h> | Defines data types such as pid_t. |
| <sys/wait.h> | Provides process control functions like wait(). |
| <unistd.h> | Declares POSIX system calls such as fork(). |
| <stdio.h> | Input/output functions like printf(). |
| <stdlib.h> | Utility functions including exit(). |
Compiling and Running a C Program (GCC)
Option 1:
gcc <file.c> -o <program>
./<program>
Option 2:
gcc -c <file.c>
gcc -o <program> <file.o>
./<program>
Last modified: Sunday, 1 February 2026, 8:27 PM