Go Back   The UNIX and Linux Forums > Operating Systems > HP-UX


HP-UX HP-UX (Hewlett Packard UniX) is Hewlett-Packard's proprietary implementation of the Unix operating system, based on System V.

Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 07-11-2012
Registered User
 
Join Date: Jun 2011
Posts: 217
Thanks: 43
Thanked 0 Times in 0 Posts
Question File descriptor directory in HPUX

Hi,

In solaris I remember this direcotry structure


Code:
/proc/<pid>/fd

in this directory


Code:
ls -l | wc -l

would give me the number of file descriptor for that process.

Where can I find the similar in HPUX

Last edited by mohtashims; 07-11-2012 at 03:32 PM..
Sponsored Links
    #2  
Old 07-11-2012
Mead Rotor
 
Join Date: Aug 2005
Location: Saskatchewan
Posts: 16,393
Thanks: 492
Thanked 2,536 Times in 2,419 Posts
HPUX has nothing like it.

The closest you might get is the various information ps can offer, which turns out to be quite a bit.
Sponsored Links
    #3  
Old 07-11-2012
admin_xor's Avatar
Registered User
 
Join Date: Jun 2011
Posts: 450
Thanks: 13
Thanked 77 Times in 74 Posts
Are you looking for open files by the process? "lsof" is available for HP-UX as well.


Code:
lsof -c process_name

    #4  
Old 07-11-2012
methyl methyl is offline Forum Staff  
Moderator
 
Join Date: Mar 2008
Posts: 6,388
Thanks: 286
Thanked 668 Times in 640 Posts
And you can drill down on a process with HP-UX glance and see which files that process has open.
Very important when configuring kernel parameters to know how many files a database client actually opens (it can be a large number).




@Corona688
"HPUX has nothing like it."

Sorry, but that is a rubbish post.
Also there is no "ps" option for file descriptors on any unix/Linux Operating System.

Last edited by methyl; 07-11-2012 at 07:23 PM.. Reason: rewrite
Sponsored Links
    #5  
Old 07-12-2012
Registered User
 
Join Date: Jun 2011
Posts: 217
Thanks: 43
Thanked 0 Times in 0 Posts
Question

Quote:
Originally Posted by admin_xor View Post
Are you looking for open files by the process? "lsof" is available for HP-UX as well.


Code:
lsof -c process_name

I need the number of file descriptor a process has opened and the max limit that is set on my system.

Can you help me with the exact command ?
Sponsored Links
    #6  
Old 07-12-2012
admin_xor's Avatar
Registered User
 
Join Date: Jun 2011
Posts: 450
Thanks: 13
Thanked 77 Times in 74 Posts
Yes, with lsof it's very easy.

To check numbers of file descriptors opened by a process:

Code:
lsof -p PID | awk '$4~/^[0-9]/' | wc -l

To check the max. limit that's set, on ksh type this:

Code:
ulimit -n

The Following User Says Thank You to admin_xor For This Useful Post:
mohtashims (07-13-2012)
Sponsored Links
    #7  
Old 07-13-2012
Peasant's Avatar
Registered User
 
Join Date: Mar 2011
Posts: 512
Thanks: 14
Thanked 104 Times in 102 Posts
Check out these kernel parameters.

Code:
# kctune maxfiles maxfiles_lim
Tunable       Value  Expression  Changes
maxfiles       2048  Default
maxfiles_lim   4096  Default     Immed
# ulimit -a | grep nofiles
nofiles(descriptors) 2048

This will set it system wide, and with ulimit command you can change per user inside .profile, but not above the kernel parameter maxfiles_lim.

Hope that helps.
Regards
Peasant.
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
file descriptor KSH LiorAmitai Shell Programming and Scripting 6 05-16-2011 05:46 AM
File Descriptor siba.s.nayak UNIX for Dummies Questions & Answers 1 12-12-2008 05:10 AM
File Descriptor rimser9 Shell Programming and Scripting 3 08-14-2008 06:34 AM
File Descriptor Help rahulrathod UNIX for Dummies Questions & Answers 3 10-14-2004 05:08 AM
bad file descriptor? ftb UNIX for Dummies Questions & Answers 1 02-20-2002 06:19 PM



All times are GMT -4. The time now is 05:53 PM.