LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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,373

Rep: Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962
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: Dehradun, Uttarakhand, India
Distribution: RHEL, CentOS, Debian, Oracle Solaris 10
Posts: 1,412

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, 12:44 AM   #4
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,225

Rep: Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021
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: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,524
Blog Entries: 27

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


All times are GMT -5. The time now is 09:30 PM.

Main Menu
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