ShadowColossus
asked on
finding the bash script running
I was trying to determine which process was accessing a folder in my system and noticed it had a pid of 15742. However, I couldn't determine where this bash script was running (like the location of the bash file or which user is running it) Any ideas?
ps -ef | grep 15742
root 6432 5000 0 22:14 pts/4 00:00:00 grep 15742
root 15742 15662 0 16:25 pts/1 00:00:00 -bash
ps -ef | grep 15742
root 6432 5000 0 22:14 pts/4 00:00:00 grep 15742
root 15742 15662 0 16:25 pts/1 00:00:00 -bash
You can do an fuser -uc /folder to see whih pid is accessing it.
-bash is a login shell (see the "-") in front.
So it's not a script, but a user login session whose current directory is the "folder" in question.
Issue "who | grep pts/1" to find the name of the responsible user and their login time.
Additionally, you can grep for "15662" which is the parent PID of the shell, to (possibly) get further hints.
wmp
So it's not a script, but a user login session whose current directory is the "folder" in question.
Issue "who | grep pts/1" to find the name of the responsible user and their login time.
Additionally, you can grep for "15662" which is the parent PID of the shell, to (possibly) get further hints.
wmp
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
OK,
not only the name, but also the host where the login came from, and the time of login ...
not only the name, but also the host where the login came from, and the time of login ...
w
It will give more information on the running process