Variable: insert-directory-program

insert-directory-program is a customizable variable defined in files.el.gz.

Value

"ls"

Documentation

Absolute or relative name of the ls-like program.

This is used by insert-directory and dired-insert-directory
(thus, also by dired). For Dired, this should ideally point to
GNU ls, or another version of ls that supports the "--dired" flag. See dired-use-ls-dired.

On GNU/Linux and other capable systems, the default is "ls".

On *BSD and macOS systems, the default "ls" does not support the "--dired" flag. Therefore, the default is to use the
"gls" executable on such machines, if it exists. This means
that there should normally be no need to customize this when installing GNU coreutils using something like ports or Homebrew.

This variable was added, or its default value changed, in Emacs 30.1.

View in manual

Probably introduced at or before Emacs version 30.1.

Source Code

;; Defined in /usr/src/emacs/lisp/files.el.gz
(defcustom insert-directory-program
  (if (and (memq system-type '(berkeley-unix darwin))
           (executable-find "gls"))
      "gls"
    "ls")
  "Absolute or relative name of the `ls'-like program.
This is used by `insert-directory' and `dired-insert-directory'
\(thus, also by `dired').  For Dired, this should ideally point to
GNU ls, or another version of ls that supports the \"--dired\"
flag.  See `dired-use-ls-dired'.

On GNU/Linux and other capable systems, the default is \"ls\".

On *BSD and macOS systems, the default \"ls\" does not support
the \"--dired\" flag.  Therefore, the default is to use the
\"gls\" executable on such machines, if it exists.  This means
that there should normally be no need to customize this when
installing GNU coreutils using something like ports or Homebrew."
  :group 'dired
  :type 'string
  :initialize #'custom-initialize-delay
  :version "30.1")