GNU Emacs
Emacs
Dashboard

30.14 Hiding Subdirectories

Hiding a subdirectory means to make it invisible, except for its header line.

$

Hide or show the subdirectory that point is in, and move point to the next subdirectory ( dired-hide-subdir). This is a toggle. A numeric argument serves as a repeat count.

M-$

Hide all subdirectories in this Dired buffer, leaving only their header lines ( dired-hide-all). Or, if any subdirectory is currently hidden, make all subdirectories visible again. You can use this command to get an overview in very deep directory trees or to move quickly to subdirectories far away.

Ordinary Dired commands never consider files inside a hidden subdirectory. For example, the commands to operate on marked files ignore files in hidden directories even if they are marked. Thus you can use hiding to temporarily exclude subdirectories from operations without having to remove the Dired marks on files in those subdirectories.

See Subdirectories in Dired, for how to insert a subdirectory listing, and see Updating the Dired Buffer, for how to delete it.