/usr/lib/radare/bin/fds is in radare-common 1:1.5.2-6.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | #!/bin/sh
# author : pancake
PID=$1
if [ -z "${PID}" ]; then
echo "Usage: rsc fds [pid]"
echo " list filedescriptors of a pid"
exit 1
fi
lsof -h > /dev/null 2>&1
if [ $? = 0 ]; then
lsof -p $PID
else
if [ "`uname`" = "FreeBSD" ]; then
fstat > /dev/null 2>&1
else
fstat -h > /dev/null 2>&1
fi
if [ $? = 0 ]; then
fstat -p $PID
else
ls -l /proc/$PID/fd
fi
fi
|