Get the App
SLTechnology News&Howtos  ›  Network Security  › 

Show only hidden files or directories under a directory

Shulou Source: shulou.com Published: 2022-06-01 04:56:00 10月04日 Update

This article is for learning only:

Show all hidden files and directories

[root@localhost] # ls-ad. *

Ls: displaying list information

-a: shows that all files under the current directory or path contain hidden files

D: show only the contents of the current directory itself

The effect diagram is attached below.

Show all hidden directories

[root@localhost] # ls-d. * /

/ identified as a catalog file

The following is the effect picture

Show all hidden files

[root@localhost ~] # ll-ad. * | grep "^ -"

Ll: displaying in long format

. *: all files in the current directory that begin with a dotted star

"^ -": (-) means to reverse an ordinary document (^).

Meaning: show all hidden files that begin with a dot in the current directory in a long format and filter out files that are not ordinary file types.

The following is the effect picture

Or

[root@localhost] # find / root/-type f-name ". *"

Find all files under root that are normal files of type f and whose names begin with a dot.

Tags: File directory ordinary beginning effect effect format type information content name meaning meaning path don't learn Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei MySQL MariaDB Linux Shulou Tech Info