Linux Hidden File Path Regular Expression

A regular expression to match the path of a hidden file in Linux.

/^\/(?:[^/]+\/)*\.[^/]*/

Linux Hidden File Path Examples:

  • /usr/ad/.dd
  • /root/.gitignore
  • /.gitignore