LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
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, 05: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, 05:12 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,415

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

Rep: Reputation: 303Reputation: 303Reputation: 303Reputation: 303
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, 01:44 AM   #4
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.6, Centos 5.10
Posts: 16,324

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

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

Rep: Reputation: Disabled
lsof -r 1 <script name>
 
Old 05-15-2012, 05:27 AM   #6
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,563
Blog Entries: 29

Rep: Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 09:33 AM
Open file without specifying exact location usernameinuse Linux - Newbie 6 06-16-2010 03:32 PM
System Boots From grub.conf in unknown location pgb205 Linux - Distributions 6 02-19-2010 04:10 PM
find the exact location of a running exec file cahdecah General 4 08-16-2007 11:53 AM
Pathbeing set from unknown location camroe Linux - General 1 09-29-2004 04:39 PM


All times are GMT -5. The time now is 01:03 PM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration