Skip to content

Commit

Permalink
remove susers utility and add kuids
Browse files Browse the repository at this point in the history
  • Loading branch information
gaardhus committed Nov 8, 2024
1 parent 055ca48 commit da4c508
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions docs/server/tips.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,19 +240,26 @@ id <username> | tr "," "\n" | grep srv-sodas
Check users logged on the server
```bash
users
w
```
Check users with access to the server
Custom function to lookup multiple KUIDs (can be added to `.bashrc`):
```bash
function susers() {
for user in /home/*; do
username=$(basename $user)
if [[ $username =~ ^[a-zA-Z]{3}[0-9]{3}$ ]]; then
kuid "$username"
echo "============================"
fi
function kuids() {
while read -r username; do
if [[ $username =~ ^[a-zA-Z]{3}[0-9]{3}$ ]]; then
kuid "$username"
echo "============================"
fi
done
}
```
Usage:
```bash
ls /home/ | kuids
users | kuids
```

0 comments on commit da4c508

Please sign in to comment.