1

what is the command to show the running processes by the current user? I want to see stuff only I have launched from the command line or via the desktop, without all the desktop stuff and system services and de running in the background.

Is there something like that?

Or I need to see all the running process when I type htop ?

  • 1
    "The desktop stuff" was technically launched by you. – Kusalananda Jul 29 '16 at 14:34
2

Processes can easily be filtered by user. In htop, press u and select a user name, or run htop -u $(id -un). You can also make other users' processes visible but grayed out by ticking “Setup → Display options → Shadow other users' processes”.

The “desktop stuff” are processes running under your user. There's no concept of “process that's part of the desktop stuff” vs “process that's an independent application”. As far as the operating system is concerned, the parts that make up the “desktop stuff” are applications like any other. The definition of “desktop stuff” vs “other stuff” is purely arbitrary. A program launched manually by clicking on an icon is indistinguishable from a widget that was started automatically at the start of the session.

If you run programs from a terminal, you can run the ps command in a terminal. By default, it lists only programs started from that terminal.

While you could list all the programs started from any terminal, that wouldn't be meaningful, since it wouldn't include programs started from a desktop menu or icon.

If you're only interested in GUI programs that aren't part of the desktop, listing windows would be more meaningful. Try wmctrl -lp.

1

If you want to see all processes belonging to user $USER in top, either press u and enter the username, or start top with

$ top -U $USER

To get a simple list of processes on the command line:

$ pgrep -l -U $USER

A similar list with ps:

$ ps -U $USER

According to the htop manual, this would start htop showing only the processes belonging to user $USER:

$ htop -u $USER

Note that the variable USER usually contains your own username. I'm using it here as an example.

  • So, maybe I should ask diffrently. How to hide the system processes in htop ? – John Doeherskij Jul 29 '16 at 22:17
  • @JohnDoeherskij htop will show you either all processes or the ones belonging to a particular user. – Kusalananda Jul 29 '16 at 22:21
0

Try using

ps aux | grep ubuntu

Replace ubuntu with your desktop username. Your system users may be root, syslog, etc

If you're not sure of your username, on the terminal issue :~$ whoami

You should see something like

ubuntu@ip-172-31-46-27:~$ whoami
ubuntu

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.