Sometimes when there are too many users logged in it can cause my computer to become very slow and laggy due to low amount of available RAM. I would like to be able to quickly log out the other users from the command line instead of manually switching into each user and logging them out.
Is this possible?
ps auxf
then you notice (left-most column has effective username) that this method doesn't kill all the processes which are executed by the current user (so probably you aren't logged out). The method of @precise seems to attend to this problem, though I don't feel comfortable with sendingSIGKILL
. – Dor Sep 29 '16 at 23:13shutdown
so it can give warning (allowing work to be saved) before forcibly logging out. That would optionally just switch to the login as if changing sessions, leaving the user session running in the background. – pbhj Nov 25 '18 at 19:51