How can you check the running status of processes on Linux?
There are several common commands that can be used in Linux to view the status of processes. Here are a few examples:
- The ps command is used to take a snapshot of the current active processes. By using different parameters, you can obtain various information, such as running ps aux to view detailed information about all active processes.
- The top command: displays real-time information about active processes and system resource usage. Press ‘s’ to sort processes by CPU usage, and press ‘m’ to sort processes by memory usage.
- The htop command provides more interactive features and information than the top command, and can be installed using a package manager like apt-get (sudo apt-get install htop).
- The pstree command displays the hierarchical structure of processes in a tree format. Running the pstree command shows the parent-child relationship of the current processes.
- Systemctl command is used to manage system services. You can use the systemctl status command to check the running status of a specific service.
- lsof command: Used to list open files and processes. You can use the lsof command to view the files opened by a specific process.
These commands can be directly executed in the terminal, using appropriate parameters as needed to retrieve the desired information.