How to find the path of process in sunOS?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to find the path of process in sunOS?
# 1  
Old 04-12-2015
How to find the path of process in sunOS?

Please support for this issue,

I have a below process running on my machine

Code:
  16108 /usr/jdk/instances/jdk1.6.0/bin/java -Xms3072m -Xmx3072m -Dcbcm.root=/java3_app
    20992 java -Djob.name=SOME_JOB_IS_RUNNING -Dcbcm.root=/java3_apps1/cbcm_js/j

For PID 16108 I can see that its pointing to this path
Code:
/usr/jdk/instances/jdk1.6.0/bin/java

But I want to know 20992 Is pointing to which path of java. As when i see java its confusing me because system has many java in that. PID 16108 is pointign to 1.6.0_75 and when i do which java i see 1.6.0_29

When i tried to do

Code:
ls -lrt /proc/$pid/exe

no result

i tried
Code:
readlink -f  ls -lrt /proc/$pid/exe

also .

Below are the file present in my pid directory

Code:
               -rw-------   1 cbcm_js  oinstall 1164443648 Apr 12 05:53 as
  -r--------   1 cbcm_js  oinstall     152 Apr 12 05:53 auxv
  dr-x------   2 cbcm_js  oinstall      32 Apr 12 05:53 contracts
  -r--------   1 cbcm_js  oinstall      32 Apr 12 05:53 cred
  --w-------   1 cbcm_js  oinstall       0 Apr 12 05:53 ctl
  lr-x------   1 cbcm_js  oinstall       0 Apr 12 05:53 cwd ->
  dr-x------   2 cbcm_js  oinstall    8208 Apr 12 05:53 fd
  -r--r--r--   1 cbcm_js  oinstall    8408 Apr 12 05:53 lpsinfo
  -r--------   1 cbcm_js  oinstall   67808 Apr 12 05:53 lstatus
  -r--r--r--   1 cbcm_js  oinstall   20072 Apr 12 05:53 lusage
  dr-xr-xr-x  77 cbcm_js  oinstall    2048 Apr 12 05:53 lwp
  -r--------   1 cbcm_js  oinstall   29760 Apr 12 11:32 map
  dr-x------   2 cbcm_js  oinstall    5152 Apr 12 05:53 object
  -r--------   1 cbcm_js  oinstall  173352 Apr 12 05:53 pagedata
  dr-x------   2 cbcm_js  oinstall   13360 Apr 12 05:53 path
  -r--------   1 cbcm_js  oinstall      72 Apr 12 05:53 priv
  -r--r--r--   1 cbcm_js  oinstall     336 Apr 12 05:53 psinfo
  -r--------   1 cbcm_js  oinstall   34080 Apr 12 05:53 rmap
  lr-x------   1 cbcm_js  oinstall       0 Apr 12 05:53 root ->
  -r--------   1 cbcm_js  oinstall    2304 Apr 12 05:53 sigact
  -r--------   1 cbcm_js  oinstall    1232 Apr 12 05:53 status
  -r--r--r--   1 cbcm_js  oinstall     256 Apr 12 05:53 usage
  -r--------   1 cbcm_js  oinstall       0 Apr 12 05:53 watch
  -r--------   1 cbcm_js  oinstall   53960 Apr 12 05:53 xmap

# 2  
Old 04-12-2015
Code:
ls -l /proc/$pid/path

will show you all of the files that the process has open file descriptors for.

Code:
pargs -e $pid

Will show you environment variables like CLASSPATH and PATH

You probably need both to really understand what is going on. The order of entries in CLASSPATH can affect the process.
# 3  
Old 04-12-2015
I tried
Code:
ls -l /proc/$pid/path

but there are all jar file inside sitting inside the lib.

i will try the other coomand, is there any other way to find out how to find the path of that java pid is pointing to ?

Last edited by jim mcnamara; 04-12-2015 at 10:55 PM..
# 4  
Old 04-12-2015
Yes - the pargs command gives you the CLASSPATH - along with other things.

The order of the CLASSPATH entries is important. You need to note this concept. OR it will drive you crazy later on. You choose.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Manipulate files with find and fuser not working as expected on SunOs

Greetings, For housekeeping, I use the following command: find /some/path -type f -name "*log*" ! -exec fuser -s "{}" 2>/dev/null \; -exec ls -lh {} \; It finds all log files not currently in use by a process and manipulates them. This command always works on linux and redhat machines,... (2 Replies)
Discussion started by: dampio
2 Replies

2. UNIX for Dummies Questions & Answers

Way to get Code/path , which is executing under a process?

Dear All, Please help me in finding solution for below problem. I need a command or script to get code or path(from which location code is being executed), which is executing under a process ID. I dont have google access here,Please help me in finding solution. Thank you. (3 Replies)
Discussion started by: subbarao12
3 Replies

3. Shell Programming and Scripting

Loop to process 2 files with same name in different path

Hello forum members, I hope you can help me with this I don't know hot to reach. I have a list of files in "/home/MyPath1/" and in "/home/MyPath2/". The files have the same name in both folders. (but different content, the content doesn't matter here I think) /home/MyPath1/ filename1.txt... (4 Replies)
Discussion started by: Ophiuchus
4 Replies

4. AIX

tprof, truncate the process path

Hi, i tryed tprof -skex sleep 6 but... Process PID TID Total Kernel User Shared Other Java ======= === === ===== ====== ==== ====== ===== ==== wait 57372 77863 31.31 31.31 0.00 0.00 0.00 0.00 wait ... (1 Reply)
Discussion started by: zanac
1 Replies

5. Shell Programming and Scripting

SunOS: How to exclude directory in find command?

Hi All, First my OS version is: ksh:0$ uname -a SunOS 5.9 Generic_122300-48 sun4u sparc SUNW,Sun-Fire-V440 I want to exclude the following DIR(./country111) in my search pattern: ksh:0$ find . -name "*.tar" ./country111/COUNTRY_BATCH-801.tar ./country111/COUNTRY_BATCH-802.tar... (3 Replies)
Discussion started by: saps19
3 Replies

6. Shell Programming and Scripting

Find files modified in last hour sunOS 5.10

trying to find a way to locate files modified in the last hour in a shell script, unfortunately the command 'find . -mmin -60' is not supported on SunOS 5.10 (works on OpenSolaris 5.11 :mad:) Does anyone know a method of doing this in shell script on 5.10? cheers (19 Replies)
Discussion started by: rich@ardz
19 Replies

7. Solaris

How to find (specific) directories in SunOS 5.9?

Hi all! I try to find all directories which match a specific path, e.g., to find all directories matching "data/temp/" assuming a directory structure like this: /foo/data/temp /foo/foo/data/temp I tried the find command, however, I wasn't successful. The "find" command under SunOS 5.9 DOES... (7 Replies)
Discussion started by: tbeer
7 Replies

8. UNIX for Advanced & Expert Users

How do I find the version of Informatica, Cognos and DataStage on SUNOS 5.8

How do I find the version of Informatica, Cognos and DataStage using a unix command on my Unix machine SunOS 5.8. I don't want to use front end to find this information. (1 Reply)
Discussion started by: gram77
1 Replies

9. Shell Programming and Scripting

how to find the chid process id from given parent process id

how to find the chid process id from given parent process id.... (the chid process doesnot have sub processes inturn) (3 Replies)
Discussion started by: guhas
3 Replies

10. UNIX for Advanced & Expert Users

Migration of binary file from Sunos 5.8 to Sunos 5.9

I have compiled binary file using "cc" on SunOS 5.8 and the same binary file i have copied to SunOS 5.9 and it is giving me core dump error.I want to know whether migration of compiled code from lower version to higer version created this problem. how can i solve this problem.I am pasting the core... (1 Reply)
Discussion started by: Arvind Maurya
1 Replies
Login or Register to Ask a Question