← 返回命令列表

Linux command

namei 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Resolve pathnames

namei [path/to/a] [path/to/b]

Example

namei -l [path/to/file]

Example

namei -m [path/to/file]

Example

namei -o [path/to/file]

Don't follow

namei -n [path/to/file]

Example

namei -lmo [path/to/file]

说明

namei follows a pathname until a terminal point is found (file, directory, device, etc.), displaying each component of the path. It is particularly useful for diagnosing "too many levels of symbolic links" errors. The output shows each path component with its type indicator: d (directory), l (symbolic link), - (regular file), c (character device), b (block device), s (socket), p (FIFO/pipe).

参数

-l, --long
Use long-listing format (same as -m -o -v)
-m, --modes
Show mode bits of each file type in ls style
-o, --owners
Show owner and group name of each file
-n, --nosymlinks
Don't follow symbolic links
-x, --mountpoints
Show mountpoint directories with D
-v, --vertical
Vertical alignment of modes and owners
-Z, --context
Show security context of each file
-h, --help
Display help
-V, --version
Display version

FAQ

What is the namei command used for?

namei follows a pathname until a terminal point is found (file, directory, device, etc.), displaying each component of the path. It is particularly useful for diagnosing "too many levels of symbolic links" errors. The output shows each path component with its type indicator: d (directory), l (symbolic link), - (regular file), c (character device), b (block device), s (socket), p (FIFO/pipe).

How do I run a basic namei example?

Run `namei [path/to/a] [path/to/b]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -l, --long do in namei?

Use long-listing format (same as -m -o -v)