This script will output a list of the files that are open by a given process:
#!/bin/bash PROCESS=$1 log_found=`ps faux|grep -v grep|grep $PROCESS|awk {print $2}` if [ "$log_found" == "" ]; then echo "No process found" else echo "Open files:" for PID in $log_found; do #ls -l /proc/$PID/fd/ | awk {print $NF;} ls -l /proc/$PID/fd/ done fi
No comments:
Post a Comment