How do you view and manage running processes?

Beginner

Answer

Several commands help manage processes:

# View processes
ps aux                  # All processes with details
ps -ef                  # Full format listing
ps -u username          # Processes for specific user
pstree                  # Process tree view
# Real-time process monitoring
top                     # Interactive process viewer
htop                    # Enhanced version of top
atop                    # Advanced system monitor
# Process information
jobs                    # Current shell jobs
pgrep process_name      # Find process IDs by name
pidof process_name      # Get PID of running process

Process states:

  • R: Running
  • S: Sleeping (waiting)
  • D: Uninterruptible sleep
  • Z: Zombie
  • T: Stopped