Process Management - Class10
Process Management
When you launch any application or command, a process is created for that particular application and runs in the background (similar to the Task Manager in Windows). Each process is identified by a unique Process ID (PID).
Commands for Process Management:
-
ps: Lists the running processes.ps -eaf: Lists all running processes.
-
Kill a process by PID:
kill -9 <PID>: Forcefully terminates the process with the specified PID.
-
Kill a process by name:
pkill <process_name>: Terminates the process by its name.
-
top: Displays real-time system performance, including:- Uptime
- Tasks (foreground and background)
- CPU utilization
- Memory utilization
- Swap memory usage
Swap Memory:
Swap memory is used when the main memory (RAM) is full. The Linux kernel may move inactive or "sleeping" processes to swap memory to free up RAM for active processes.
Package Management
In Linux, applications are distributed as packages. There are several ways to install packages:
-
RPM (Red Hat Package Manager):
- RPM files have the
.rpmextension. - Example:
python3.orge.12912.rpm
Commands:
-
Install an RPM package:
rpm -ivh <package_name>Example:
rpm -i python3.orge.12912.rpm -
List installed RPM packages:
rpm -qa <rpm_package_name>Example:
rpm -qa python3.orge.12912.rpm -
Remove/Uninstall an RPM package:
rpm -evh <rpm_package_name>
- RPM files have the
-
YUM (Yellowdog Updater, Modified):
- YUM is a higher-level package manager that uses RPM packages and resolves dependencies automatically.
-
APT (Advanced Package Tool):
-
Used in Debian-based distributions like Ubuntu.
-
Install a package:
apt-get install <package_name>Example:
apt-get install python3 -
Uninstall a package:
apt-get remove <package_name>
-
-
wget:- Used to download files or packages from the internet.
- Syntax:
wget <URL>
Types of Packages:
- Online Packages: Installed directly from the internet.
- Offline Packages: Downloaded and installed manually (e.g.,
.rpmor.debfiles).