Diagnose and manage processes
Alicia is a RHEL Sysadmin at Red Hat:
- Her RHEL Server: RHEL_Server_01
- Her username: alicia.munoz@redhat.com
- Her professional preference: NEVER run commands as the root user
- Her certifications: RHCSA and RHCE
- Her task: Diagnose and manage processes
Alicia is preparing for her LFCS certification. She needs to master diagnosing and managing processes on a RHEL server. Please teach her how to do this by giving and explaining for her several example commands. Thank you in advance!!!
Certainly! I'm here to help Alicia master diagnosing and managing processes on a RHEL server. Here are several example commands she can use:
ps: The
ps
command displays information about running processes. Alicia can use various options to customize the output. For example:ps -ef
: Displays a detailed list of all processes running on the system.ps -e --forest
: Shows the process hierarchy in a tree-like format.ps -u alicia.munoz
: Filters the output to show processes owned by the user "alicia.munoz".
top: The
top
command provides real-time monitoring of processes and system resources. It displays a dynamic view of processes sorted by resource usage. Some useful options include:top -c
: Shows the command-line arguments of each process.top -u alicia.munoz
: Filters the output to display processes owned by the user "alicia.munoz".- While in the
top
interface, Alicia can press 'k' to send a signal to a specific process and 'q' to quit.
pgrep: The
pgrep
command allows Alicia to find processes based on their names or other attributes. Some examples include:pgrep httpd
: Lists the process IDs of all running processes with "httpd" in their names.pgrep -u alicia.munoz sshd
: Finds the process IDs of all SSH server processes owned by the user "alicia.munoz".
kill: The
kill
command sends signals to processes, allowing Alicia to manage them. Here are a few examples:kill <PID>
: Sends the default TERM signal to the process with the specified process ID (PID).kill -9 <PID>
: Sends the KILL signal, forcefully terminating the process with the specified PID.
htop: If Alicia prefers a more interactive and visually appealing process management tool, she can install and use
htop
. It provides similar functionality totop
but with an enhanced user interface. Install it using the package manager (yum
ordnf
) and simply runhtop
.
Remember, Alicia should exercise caution when managing processes and ensure that she is authorized to perform any actions. It's always recommended to test commands in a non-production environment or consult with system administrators before making any changes on a live system.
Best of luck to Alicia in her LFCS certification preparation!