Solved

finding the bash script running

Posted on 2012-03-16
6
357 Views
Last Modified: 2012-08-10
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
0
Comment
Question by:ShadowColossus
6 Comments
 
LVL 11

Expert Comment

by:legolasthehansy
ID: 37730117
Try lsof -p 15742
It will give more information on the running process
0
 
LVL 11

Expert Comment

by:jgiordano
ID: 37730270
You can do an fuser -uc /folder to see whih pid is accessing it.
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 37730354
-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
0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
LVL 51

Accepted Solution

by:
ahoffmann earned 500 total points
ID: 37731441
> Issue "who | grep pts/1" to find the name ...
why?
ps already tells that it is root :)
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 37731449
OK,

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

Expert Comment

by:ahoffmann
ID: 37731464
w
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question