PATHCHK(1) General Commands Manual PATHCHK(1)

pathchkcheck pathname validity

pathchk [-pP] pathname...

pathchk checks each pathname for their validity and portability.

By default, pathchk does the following checks, based on the underlying filesystem:

Note that non-existing path components aren't seen as an error by pathchk.

Do not perform checks against the underlying filesystem, meaning:
  • _POSIX_PATH_MAX is used instead of PATH_MAX
  • _POSIX_NAME_MAX is used instead of NAME_MAX
  • Directories aren't checked for user reachability
  • POSIX Portable Character Set is the only reference for invalid byte sequences
Perform the following additional checks:
  • Doesn't contains a path component whose first character is the <hyphen-minus> character
  • Isn't empty

The pathchk utility exits 0 on success, and >0 if an error occurs.

test(1)

pathchk should be compliant with IEEE Std 1003.1-2024 (“POSIX.1”) specification.

Haelwenn (lanodan) Monnier <contact+utils@hacktivis.me>

2024-04-19 Linux 6.6.67-gentoo-x86_64