Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
find who's current in some path
#!/bin/bash
if [ $# -ne 1 ]
then
echo "Usage: sudo whoisat /path"
else
path=$1
for proc in $(ps aux | awk '/pts/ {print $2}')
do
ls -l --time-style=+'%F %T' /proc/$proc/cwd 2>/dev/null
done | grep $path | awk '{print $3, $4, $6, $7, $8, $NF}' | column -t
fi
Owner

pityonline commented Jun 9, 2015

Rename with specification

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment