ncheck Command

Purpose

Generates path names from i-node numbers.

Syntax

ncheck [ [ [  -a ] [  -i InNumber ... ] ] | [  -s ] ] [-o Options] FileSystem ]

Description

The ncheck command displays the i-node number and path names for filesystem files. It uses question marks (??) displayed in the path to indicate a component that could not be found. Path names displayed with ... (ellipses) at the beginning indicate either a loop or a path name of greater than 10 entries. The ncheck command uses a simple hashing alogrithm to reconstruct the path names that it displays. Because of this, it is restricted to filesystems with less than 50,000 directory entries.

Flags

Item Description
-a Lists the . (dot) and .. (dot dot) file names.
-i InNumber  Lists only the file or files specified by the InNumber parameter.
-o Options Specifies a comma-separated list of implementation-specific options for a virtual file system.

The following options are specific to the enhanced journaled file system (JFS2

-o snapshot=snapName):

Specifies the name of the internal snapshot subject to the ncheck command. The file system owning the snapshot must be mounted.
-s Lists only special files and files with set-user-ID mode.

Security

Attention RBAC users and Trusted AIX® users: This command can perform privileged operations. Only privileged users can run privileged operations. For more information about authorizations and privileges, see Privileged Command Database in Security. For a list of privileges and the authorizations associated with this command, see the lssecattr command or the getcmdattr subcommand.

Examples

  1. To list the i-node number and path name of each file in the default file systems, enter:
    ncheck
  2. To list all the files in a specified file system, enter:

    ncheck  -a /

    This lists the i-node number and path name of each file in the / (root) file system, including the .(dot) and .. (dot dot) entries in each directory.
  3. To list the name of a file when you know its i-node number, enter:

    ncheck  -i 690 357 280 /tmp

    This lists the i-node number and path name for every file in the /tmp file system with i-node numbers of 690, 357, or 280. If a file has more than one link, all of its path names are listed.
  4. To list special and set-user-ID files, enter:

    ncheck  -s /

    This lists the i-node and path name for every file in the / (root) file system that is a special file (also called a device file) or that has set-user-ID mode enabled.