Thursday, June 28, 2007

Recursively Display File and Directory Inodes

I've had a few requests on how to show inodes recursively. I would recommend using the ls command with the recursive option. Using the /etc/security directory as an example, here's a quick way of doing that.

# cd /etc/security
# ls
audit audit_startup bsmunconv lib
audit_class audit_user dev policy.conf
audit_control audit_warn device_allocate prof_attr
audit_data auth_attr device_maps spool
audit_event bsmconv exec_attr

# ls -iR | more
.:
429447 audit
425561 audit_class
425562 audit_control
425751 audit_data
425563 audit_event
425747 audit_startup
425564 audit_user
425565 audit_warn
425568 auth_attr
425566 bsmconv
425567 bsmunconv
437267 dev
425749 device_allocate
425750 device_maps
425569 exec_attr
445066 lib
425571 policy.conf
425570 prof_attr
448971 spool

./audit:
433367 localhost

./audit/localhost:
433368 files

./dev:
437268 audio
437269 fd0
437270 sr0
437271 st0
437272 st1

./lib:
445067 audio_clean
445068 fd_clean
445069 sr_clean
445070 st_clean

./spool:
257757 S92volmgt

Show inodes for a filesystem

# ncheck /dev/dsk/c0t0d0s0

Delete and inode

No comments: