Unix (LINUX) Commands

Commands for Process Management

Command Role Example
psDisplays currently running processes in the terminal.ps
ps -efDisplays all running processes with detailed information.ps -ef
ps auxDisplays all processes, including those of other users.ps aux
ps aux | moreDisplays processes page by page.ps aux | more
topDisplays processes in real time with dynamic updates.top
jobsDisplays background and suspended jobs in the current shell.jobs
fgBrings a suspended or background job to the foreground.fg %1
bgResumes a suspended job in the background.bg %1
killSends a signal to a process, usually to stop it.kill 1234
kill -9Forces termination of an unresponsive process.kill -9 1234
&Runs a command in the background../my_program &
nohupContinues execution after logout.nohup ./my_program &
kill -lDisplays available system signals.kill -l

C Libraries

LibraryRole
<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>
Modifié le: dimanche 1 février 2026, 20:27