LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-14-2012, 04:10 AM   #1
saurav23june
LQ Newbie
 
Registered: May 2012
Location: Mumbai,India
Distribution: RHL 9.0
Posts: 1

Rep: Reputation: Disabled
Question A script is running from an unknown location.how we can find its exact location.


A script is running from an unknown location in the system.How we can find its exact location.We only know the name of the script.
 
Old 05-14-2012, 04:12 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
lsof will probably show the full path of the script for you.
 
Old 05-14-2012, 04:52 AM   #3
Satyaveer Arya
Senior Member
 
Registered: May 2010
Location: Palm Island
Distribution: RHEL, CentOS, Debian, Oracle Solaris 10
Posts: 1,420

Rep: Reputation: 305Reputation: 305Reputation: 305Reputation: 305
You can also use locate command to locate the full path with file name of your file.
Example-
Code:
# locate <filename>
 
Old 05-15-2012, 12:44 AM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,364

Rep: Reputation: 2752Reputation: 2752Reputation: 2752Reputation: 2752Reputation: 2752Reputation: 2752Reputation: 2752Reputation: 2752Reputation: 2752Reputation: 2752Reputation: 2752
Try any/all of

locate
fuser
lsof
find
ps -auxwww
 
Old 05-15-2012, 12:52 AM   #5
zXi
LQ Newbie
 
Registered: May 2012
Posts: 28

Rep: Reputation: Disabled
lsof -r 1 <script name>
 
Old 05-15-2012, 04:27 AM   #6
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
The question is similar to whether a running script can determine its own location. It is not possible in all cases. More at Greg's WIKI.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
To Find Location Of Script aman_m03 Fedora 1 01-06-2011 08:33 AM
Open file without specifying exact location usernameinuse Linux - Newbie 6 06-16-2010 02:32 PM
System Boots From grub.conf in unknown location pgb205 Linux - Distributions 6 02-19-2010 03:10 PM
find the exact location of a running exec file cahdecah General 4 08-16-2007 10:53 AM
Pathbeing set from unknown location camroe Linux - General 1 09-29-2004 03:39 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:22 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration