Operating System - HP-UX
1836634 Members
2115 Online
110102 Solutions
New Discussion

how can i get every file 's usage under /dev?

 
SOLVED
Go to solution
常有慈悲心
Regular Advisor

how can i get every file 's usage under /dev?

thanks everyone. It's appreciate.
2 REPLIES 2
John Poff
Honored Contributor
Solution

Re: how can i get every file 's usage under /dev?

Hi,

I don't know if there is a description somewhere of all the files in /dev, but you can use the 'lsdev' command to get some information about the device drivers on your system. You can match up the major number of the device files to the output from lsdev and figure out what some things are.

JP
A. Clay Stephenson
Acclaimed Contributor

Re: how can i get every file 's usage under /dev?

The key to what you are trying to do is the lssf (list special file) command. Man lssf for details.

find /dev \( -type c -o -type b \) -exec lssf {} \;

Now you need to follow that find with a find that lists all the files (typically directories) that are NOT character special or block special files.

find /dev \( ! -type c -a ! -type b \) -exec ls -l {} \;

Man find for more details.
If it ain't broke, I can fix that.