- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- The working directory of a process
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2007 01:09 AM
03-08-2007 01:09 AM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2007 01:16 AM
03-08-2007 01:16 AM
Re: The working directory of a process
if i understand well, you just have to tip :
ps -ef | grep
and it will give you the path of your process
hth
E.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2007 01:31 AM
03-08-2007 01:31 AM
Re: The working directory of a process
ps -fe |grep
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2007 01:40 AM
03-08-2007 01:40 AM
Solutionyou can use the non-standard tool "lsof" to find the "cwd" of a running process. You can find it at the "porting and archive centre for HP-UX" e.g. http://hpux.asknet.de.
For example if you check the init process you get the following output:
# lsof -p 1
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
init 1 root cwd DIR 64,0x3 2048 2 /
init 1 root txt REG 64,0x3 311296 53 / (/dev/vg00/lvol3)
init 1 root 0u REG 64,0x3 3000 290 /etc/utmp
init 1 root 1u REG 64,0x3 8960 291 /etc/utmpx
HeL
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2007 03:14 AM
03-08-2007 03:14 AM
Re: The working directory of a process
I agree with HeL. Your best bet is lsof.
You can also download lsof from http://hpux.cs.utah.edu/hppd/hpux/Sysadmin/lsof-4.77/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2007 01:38 PM
03-08-2007 01:38 PM
Re: The working directory of a process
I think you want to get information for running process using HP-Unix commands,
I am agree with all above replies,but as you are new to HP-Unix, i like to give you some more information.
1> Ps command --> report process status.
ps prints information about selected processes. Use options to specify which processes to select and what information to print about them.To know more about options, have a look on follwoing document:
http://docs.hp.com/en/B2355-60130/ps.1.html
2> lsof command -->This is a public domain tool called lsof that can be pulled from the internet and built on HP-UX. It shows all the files open by all the processes on the system, so use it in conjunction with grep if you are looking for a particular directory on a particular disk. For example,
# lsof | grep /mydisk
will show all processes with open files on the /mydisk file system.
For more information,read following document:
http://h21007.www2.hp.com/dspp/tech/tech_TechSingleTipDetailPage_IDX/1,2366,1193,00.html?jumpid=reg_R1002_USEN
Here, i sugggest you go for lsof,it will solev your query.
Please also read:
http://forums1.itrc.hp.com/service/forums/helptips.do?#33 on how to reward any useful answers given to your questions.
Thanks & Regards
Reshma
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2007 06:04 PM
03-08-2007 06:04 PM
Re: The working directory of a process
U use lsof for HPUX
http://hpux.connect.org.uk/hppd/hpux/Sysadmin/lsof-4.77/
the syntax is
# lsof -p PID
This will show you all open files used by process.
-santosh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2007 10:23 PM
03-11-2007 10:23 PM