1832086 Members
3079 Online
110037 Solutions
New Discussion

inode/file information

 
SOLVED
Go to solution
William Pribble
Frequent Advisor

inode/file information

Does HP-UX have an equivalent command to the linux command "stat". I want to see the inode statistics of a file. If not does any one have a quick and dirty C program using stat() function that they can give me.

thanks everyone
4 REPLIES 4
Rodney Hills
Honored Contributor
Solution

Re: inode/file information

I came across a version a while back. Don't remember where. I have attached a "shar" save of the executable.

-- Rod Hills
There be dragons...
A. Clay Stephenson
Acclaimed Contributor

Re: inode/file information

Here is a very simple perl script which will display all the inode fields. You can modify to display any or all of the values listed.

Usage: stat.pl myfile1 myfile2 ....

If it ain't broke, I can fix that.
Allan Pincus
Frequent Advisor

Re: inode/file information

Here's a command that should generate the list:

find / -print | xargs -i ls -il {}

This will find every file on your system, and print out the inode number and associated information.

You can then redirect the output to a file, or to a sequence of cut commands using awk, or something to get what you need.

I tried it and it works fine, but it's a LONG list!!!

- Allan
Allan Pincus
Frequent Advisor

Re: inode/file information

Oops!!!!

For one file:

ls -il filename

Much simpler!