What is the command to view processes in Linux?
You can view processes in a Linux system using the following command:
- ps -ef: Displays detailed information for all processes.
- ps -aux: Displays detailed information about all processes, including processes from other users.
- Top command: displays real-time dynamic resource usage of each process in the system.
- htop command: similar to top, but with more interactive features and visual effects.
- pgrep process_name: search for the process ID based on the process name.
- The pstree command displays the relationships between processes in a tree structure.
- check the process status of a specified service by running ‘systemctl status service_name’.
- lsof -i: Displays process information related to network connections.
- lsof -i :port_number: Displays information about the processes related to the specified port number. These commands can be used according to different needs.