?
Solved

finding the bash script running

Posted on 2012-03-16
6
Medium Priority
?
361 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Get MongoDB database support online, now!

At Percona’s web store you can order your MongoDB database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card. Handle your MongoDB database support now!

 
LVL 51

Accepted Solution

by:
ahoffmann earned 2000 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses
Course of the Month11 days, 3 hours left to enroll

770 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