user-threads.sh

Get user threads

0

Votes

#!/bin/bash
# Count threads in use for a given user

die() {
  echo $1
  exit 1
}

[[ $# -eq 1 ]] || die "Need user as arg"
id $1 >/dev/null 2>&1 || die "User ($1) not found"

ps -o nlwp -u $1 | awk "NR>1{a=a+\$1} END{print a}"

Vote Here

You must earn at least 1 vote on your snippets to be allowed to vote

Terms Of Use

Privacy Policy

Featured snippets are MIT license

Gears & Masters

Advertise

DevOpsnipp.com © 2020

medium.png