Solved

finding the bash script running

Posted on 2012-03-16
6
359 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
Technology Partners: 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!

 
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

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

Suggested Solutions

Title # Comments Views Activity
Unix process listing into CSV format 3 53
Check for Linux process in script 7 67
Can't connect to FTP 18 110
Krita v3 Linux Mint/Ubuntu 16.04 9 22
If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

733 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