LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

namei

follows a pathname until a terminal point is found, displaying each component

TLDR

Resolve pathnames following symbolic links
$ namei [path/to/a] [path/to/b]
copy
Display in long-listing format
$ namei -l [path/to/file]
copy
Show mode bits of each file type
$ namei -m [path/to/file]
copy
Show owner and group of each file
$ namei -o [path/to/file]
copy
Don't follow symbolic links
$ namei -n [path/to/file]
copy
Show all information (long, modes, owners)
$ namei -lmo [path/to/file]
copy

SYNOPSIS

namei [-l] [-m] [-o] [-n] [-x] [-v] pathname...

DESCRIPTION

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).

PARAMETERS

-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

OUTPUT SYMBOLS

f: - Pathname currently being resolvedd - Directoryl - Symbolic links - Socketb - Block devicec - Character devicep - FIFO/named pipe- - Regular file? - Error of some kindD - Mountpoint (with -x)

INSTALL

sudo apt install util-linux
copy
sudo dnf install util-linux
copy
sudo pacman -S util-linux
copy
sudo apk add util-linux-misc
copy
sudo zypper install util-linux
copy
brew install util-linux
copy
nix profile install nixpkgs#util-linux
copy

CAVEATS

Symbolic link loops will cause errors. The command stops at the first unresolvable component. Permission denied errors occur if any path component is inaccessible.

HISTORY

namei is part of util-linux, the standard Linux utility collection. It provides a diagnostic tool for understanding complex path structures and resolving symlink issues.

SEE ALSO

ls(1), stat(1), readlink(1)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid