xxxxxxxxxx
ps aux | grep firefox
sudo ps aux | grep vim
sudo ps -aux | egrep 'sshd|openvpn|nginx'
xxxxxxxxxx
import subprocess
# Use the "ps" command in Linux to get the list of running processes
process = subprocess.run(['ps', 'aux'], capture_output=True, text=True)
# Print the output
print(process.stdout)