Para listar procesos por un usuario en concreto solemos utilizar el listado de procesos que realizamos siempre y le añadimos un «grep» con el nombre de usuario.
alberto@alberto-VirtualBox:~$ ps -ef | grep alberto
alberto 1586 1 0 10:25 ? 00:00:00 /usr/bin/gnome-keyring-daemon --daemonize --login
alberto 1596 1295 0 10:25 ? 00:00:00 init --user
alberto 1666 1 0 10:25 ? 00:00:00 /usr/bin/VBoxClient --clipboard
alberto 1673 1 0 10:25 ? 00:00:00 /usr/bin/VBoxClient --display
alberto 1679 1 0 10:25 ? 00:00:00 /usr/bin/VBoxClient --seamless
alberto 1685 1 0 10:25 ? 00:00:00 /usr/bin/VBoxClient --draganddrop
alberto 1703 1596 0 10:25 ? 00:00:00 ssh-agent -s
Sin embargo, nos podemos ahorrar el grep si utilizamos de forma correcta el comando «ps».
alberto@alberto-VirtualBox:~$ ps -fu alberto
UID PID PPID C STIME TTY TIME CMD
alberto 1586 1 0 10:25 ? 00:00:00 /usr/bin/gnome-keyring-daemon --daemonize --login
alberto 1596 1295 0 10:25 ? 00:00:00 init --user
alberto 1666 1 0 10:25 ? 00:00:00 /usr/bin/VBoxClient --clipboard
alberto 1673 1 0 10:25 ? 00:00:00 /usr/bin/VBoxClient --display
alberto 1679 1 0 10:25 ? 00:00:00 /usr/bin/VBoxClient --seamless
alberto 1685 1 0 10:25 ? 00:00:00 /usr/bin/VBoxClient --draganddrop
alberto 1703 1596 0 10:25 ? 00:00:00 ssh-agent -s