It is necessary to display the processes of a specific user.

ps -aux | grep ^ 'User'

Writes not found

    2 answers 2

    Generally speaking, bad practice is to use grep where you can do without it:

     ps -u username 

    Also, depending on the definition of what exactly “specific user processes” are, you can use -U instead of -u . (See man 1 ps and man 7 credentials for the difference between real and effective UID)

      Checked works:

       ps aux | grep ^username 
      • one
        and if the username is 9+ characters? - de_frag
      • one
        If the username is 9+ characters and these first 9 characters coincide with another user, then this solution will not work. The search mask must match the output of ps aux - iosp
      • if the username is 9+ characters, then in the ps output it will look like the first 7 characters and the + sign. For example, the user elasticsearch turns into elastic+ . So the search pattern is reduced to the first 7 characters. A pattern of 9 characters does not make sense at all. - de_frag
      • Thanks to everyone, everything worked, and yes, and that and that method is correct - Kirill Gorbunov