Solved

finding the bash script running

Posted on 2012-03-16
6
358 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
VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

 
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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

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…
Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
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…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

809 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