Link to home
Start Free TrialLog in
Avatar of ShadowColossus
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
Avatar of legolasthehansy
legolasthehansy

Try lsof -p 15742
It will give more information on the running process
You can do an fuser -uc /folder to see whih pid is accessing it.
Avatar of woolmilkporc
-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
ASKER CERTIFIED SOLUTION
Avatar of ahoffmann
ahoffmann
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
OK,

not only the name, but also the host where the login came from, and the time of login ...