dir(1) — Linux manual page

NAME | SYNOPSIS | DESCRIPTION | AUTHOR | REPORTING BUGS | COPYRIGHT | SEE ALSO | COLOPHON

DIR(1)                        User Commands                        DIR(1)

NAME         top

       dir - list directory contents

SYNOPSIS         top

       dir [OPTION]... [FILE]...

DESCRIPTION         top

       List information about the FILEs (the current directory by
       default).  Sort entries alphabetically if none of -cftuvSUX nor
       --sort is specified.

       Mandatory arguments to long options are mandatory for short
       options too.

       ]8;;https://www.gnu.org/software/coreutils/manual/coreutils.html#ls-a\-a, --all]8;;\
              do not ignore entries starting with .

       ]8;;https://www.gnu.org/software/coreutils/manual/coreutils.html#ls-A\-A, --almost-all]8;;\
              do not list implied . and ..

       ]8;;https://www.gnu.org/software/coreutils/manual/coreutils.html#ls--author\--author]8;;\
              with -l, print the author of each file

       ]8;;https://www.gnu.org/software/coreutils/manual/coreutils.html#ls-b\-b, --escape]8;;\
              print C-style escapes for nongraphic characters

       ]8;;https://www.gnu.org/software/coreutils/manual/coreutils.html#ls--block-size\--block-size=SIZE]8;;\
              with -l, scale sizes by SIZE when printing them; e.g.,
              '--block-size=M'; see SIZE format below

       ]8;;https://www.gnu.org/software/coreutils/manual/coreutils.html#ls-B\-B, --ignore-backups]8;;\
              do not list implied entries ending with ~

       ]8;;https://www.gnu.org/software/coreutils/manual/coreutils.html#ls-c\-c]8;;\     with -lt: sort by, and show, ctime (time of last change of
              file status information); with -l: show ctime and sort by
              name; otherwise: sort by ctime, newest first

       ]8;;https://www.gnu.org/software/coreutils/manual/coreutils.html#ls-C\-C]8;;\     list entries by columns

       ]8;;https://www.gnu.org/software/coreutils/manual/coreutils.html#ls--color\--color[=WHEN]]8;;\
              color the output WHEN; more info below

       ]8;;https://www.gnu.org/software/coreutils/manual/coreutils.html#ls-d\-d, --directory]8;;\
              list directories themselves, not their contents

       ]8;;https://www.gnu.org/software/coreutils/manual/coreutils.html#ls-D\-D, --dired]8;;\
              generate output designed for Emacs' dired mode

       ]8;;https://www.gnu.org/software/coreutils/manual/coreutils.html#ls-f\-f]8;;\     same as -a -U

       ]8;;https://www.gnu.org/software/coreutils/manual/coreutils.html#ls-F\-F, --classify[=WHEN]]8;;\
              append indicator (one of */=>@|) to entries WHEN

       ]8;;https://www.gnu.org/software/coreutils/manual/coreutils.html#ls--file-type\--file-type]8;;\
              like -F, except do not append '*'

       ]8;;https://www.gnu.org/software/coreutils/manual/coreutils.html#ls--format\--format=WORD]8;;\
              across,horizontal (-x), commas (-m), long (-l),
              single-column (-1), verbose (-l), vertical (-C)

       ]8;;https://www.gnu.org/software/coreutils/manual/coreutils.html#ls--full-time\--full-time]8;;\
              like -l --time-style=full-iso

       ]8;;https://www.gnu.org/software/coreutils/manual/coreutils.html#ls-g\-g]8;;\     like -l, but do not list owner

       ]8;;https://www.gnu.org/software/coreutils/manual/coreutils.html#ls--group-directories-first\--group-directories-first]8;;\
              group directories before files

       ]8;;https://www.gnu.org/software/coreutils/manual/coreutils.html#ls-G\-G, --no-group]8;;\
              in a long listing, don't print group names

       ]8;;https://www.gnu.org/software/coreutils/manual/coreutils.html#ls-h\-h, --human-readable]8;;\
              with -l and -s, print sizes like 1K 234M 2G etc.

       ]8;;https://www.gnu.org/software/coreutils/manual/coreutils.html#ls--si\--si]8;;\   likewise, but use powers of 1000 not 1024

       ]8;;https://www.gnu.org/software/coreutils/manual/coreutils.html#ls-H\-H, --dereference-command-line]8;;\
              follow symbolic links listed on the command line

       ]8;;https://www.gnu.org/software/coreutils/manual/coreutils.html#ls--dereference-command-line-symlink-to-dir\--dereference-command-line-symlink-to-dir]8;;\
              follow each command line symbolic link that points to a
              directory

       ]8;;https://www.gnu.org/software/coreutils/manual/coreutils.html#ls--hide\--hide=PATTERN]8;;\
              do not list implied entries matching shell PATTERN
              (overridden by -a or -A)

       ]8;;https://www.gnu.org/software/coreutils/manual/coreutils.html#ls--hyperlink\--hyperlink[=WHEN]]8;;\
              hyperlink file names WHEN

       ]8;;https://www.gnu.org/software/coreutils/manual/coreutils.html#ls--indicator-style\--indicator-style=WORD]8;;\
              append indicator with style WORD to entry names: none
              (default), slash (-p), file-type (--file-type), classify
              (-F)

       ]8;;https://www.gnu.org/software/coreutils/manual/coreutils.html#ls-i\-i, --inode]8;;\
              print the index number of each file

       ]8;;https://www.gnu.org/software/coreutils/manual/coreutils.html#ls-I\-I, --ignore=PATTERN]8;;\
              do not list implied entries matching shell PATTERN

       ]8;;https://www.gnu.org/software/coreutils/manual/coreutils.html#ls-k\-k, --kibibytes]8;;\
              default to 1024-byte blocks for file system usage; used
              only with -s and per directory totals

       ]8;;https://www.gnu.org/software/coreutils/manual/coreutils.html#ls-l\-l]8;;\     use a long listing format

       ]8;;https://www.gnu.org/software/coreutils/manual/coreutils.html#ls-L\-L, --dereference]8;;\
              when showing file information for a symbolic link, show
              information for the file the link references rather than
              for the link itself

       ]8;;https://www.gnu.org/software/coreutils/manual/coreutils.html#ls-m\-m]8;;\     fill width with a comma separated list of entries

       ]8;;https://www.gnu.org/software/coreutils/manual/coreutils.html#ls-n\-n, --numeric-uid-gid]8;;\
              like -l, but list numeric user and group IDs

       ]8;;https://www.gnu.org/software/coreutils/manual/coreutils.html#ls-N\-N, --literal]8;;\
              print entry names without quoting

       ]8;;https://www.gnu.org/software/coreutils/manual/coreutils.html#ls-o\-o]8;;\     like -l, but do not list group information

       ]8;;https://www.gnu.org/software/coreutils/manual/coreutils.html#ls-p\-p, --indicator-style=slash]8;;\
              append / indicator to directories

       ]8;;https://www.gnu.org/software/coreutils/manual/coreutils.html#ls-q\-q, --hide-control-chars]8;;\
              print ? instead of nongraphic characters

       ]8;;https://www.gnu.org/software/coreutils/manual/coreutils.html#ls--show-control-chars\--show-control-chars]8;;\
              show nongraphic characters as-is; the default, unless
              program is 'ls' and output is a terminal

       ]8;;https://www.gnu.org/software/coreutils/manual/coreutils.html#ls-Q\-Q, --quote-name]8;;\
              enclose entry names in double quotes

       ]8;;https://www.gnu.org/software/coreutils/manual/coreutils.html#ls--quoting-style\--quoting-style=WORD]8;;\
              use quoting style WORD for entry names: literal, locale,
              shell, shell-always, shell-escape, shell-escape-always, c,
              escape (overrides QUOTING_STYLE environment variable)

       ]8;;https://www.gnu.org/software/coreutils/manual/coreutils.html#ls-r\-r, --reverse]8;;\
              reverse order while sorting

       ]8;;https://www.gnu.org/software/coreutils/manual/coreutils.html#ls-R\-R, --recursive]8;;\
              list subdirectories recursively

       ]8;;https://www.gnu.org/software/coreutils/manual/coreutils.html#ls-s\-s, --size]8;;\
              print the allocated size of each file, in blocks

       ]8;;https://www.gnu.org/software/coreutils/manual/coreutils.html#ls-S\-S]8;;\     sort by file size, largest first

       ]8;;https://www.gnu.org/software/coreutils/manual/coreutils.html#ls--sort\--sort=WORD]8;;\
              change default 'name' sort to WORD: none (-U), size (-S),
              time (-t), version (-v), extension (-X), name, width

       ]8;;https://www.gnu.org/software/coreutils/manual/coreutils.html#ls--time\--time=WORD]8;;\
              select which timestamp used to display or sort; access time
              (-u): atime, access, use; metadata change time (-c): ctime,
              status; modified time (default): mtime, modification; birth
              time: birth, creation; with -l, WORD determines which time
              to show; with --sort=time, sort by WORD (newest first)

       ]8;;https://www.gnu.org/software/coreutils/manual/coreutils.html#ls--time-style\--time-style=TIME_STYLE]8;;\
              time/date format with -l; see TIME_STYLE below

       ]8;;https://www.gnu.org/software/coreutils/manual/coreutils.html#ls-t\-t]8;;\     sort by time, newest first; see --time

       ]8;;https://www.gnu.org/software/coreutils/manual/coreutils.html#ls-T\-T, --tabsize=COLS]8;;\
              assume tab stops at each COLS instead of 8

       ]8;;https://www.gnu.org/software/coreutils/manual/coreutils.html#ls-u\-u]8;;\     with -lt: sort by, and show, access time; with -l: show
              access time and sort by name; otherwise: sort by access
              time, newest first

       ]8;;https://www.gnu.org/software/coreutils/manual/coreutils.html#ls-U\-U]8;;\     do not sort directory entries

       ]8;;https://www.gnu.org/software/coreutils/manual/coreutils.html#ls-v\-v]8;;\     natural sort of (version) numbers within text

       ]8;;https://www.gnu.org/software/coreutils/manual/coreutils.html#ls-w\-w, --width=COLS]8;;\
              set output width to COLS.  0 means no limit

       ]8;;https://www.gnu.org/software/coreutils/manual/coreutils.html#ls-x\-x]8;;\     list entries by lines instead of by columns

       ]8;;https://www.gnu.org/software/coreutils/manual/coreutils.html#ls-X\-X]8;;\     sort alphabetically by entry extension

       ]8;;https://www.gnu.org/software/coreutils/manual/coreutils.html#ls-Z\-Z, --context]8;;\
              print any security context of each file

       ]8;;https://www.gnu.org/software/coreutils/manual/coreutils.html#ls--zero\--zero]8;;\ end each output line with NUL, not newline

       ]8;;https://www.gnu.org/software/coreutils/manual/coreutils.html#ls-1\-1]8;;\     list one file per line

       ]8;;https://www.gnu.org/software/coreutils/ls#ls--help\--help]8;;\ display this help and exit

       ]8;;https://www.gnu.org/software/coreutils/ls#ls--version\--version]8;;\
              output version information and exit

       The SIZE argument is an integer and optional unit (example: 10K is
       10*1024).  Units are K,M,G,T,P,E,Z,Y,R,Q (powers of 1024) or
       KB,MB,... (powers of 1000).  Binary prefixes can be used, too:
       KiB=K, MiB=M, and so on.

       The TIME_STYLE argument can be full-iso, long-iso, iso, locale, or
       +FORMAT.  FORMAT is interpreted like in date(1).  If FORMAT is
       FORMAT1<newline>FORMAT2, then FORMAT1 applies to non-recent files
       and FORMAT2 to recent files.  TIME_STYLE prefixed with 'posix-'
       takes effect only outside the POSIX locale.  Also the TIME_STYLE
       environment variable sets the default style to use.

       The WHEN argument defaults to 'always' and can also be 'auto' or
       'never'.

       Using color to distinguish file types is disabled both by default
       and with --color=never.  With --color=auto, ls emits color codes
       only when standard output is connected to a terminal.  The
       LS_COLORS environment variable can change the settings.  Use the
       dircolors(1) command to set it.

   Exit status:
       0      if OK,

       1      if minor problems (e.g., cannot access subdirectory),

       2      if serious trouble (e.g., cannot access command-line
              argument).

AUTHOR         top

       Written by Richard M. Stallman and David MacKenzie.

REPORTING BUGS         top

       Report bugs to: bug-coreutils@gnu.org
       GNU coreutils home page: <https://www.gnu.org/software/coreutils/>
       General help using GNU software: <https://www.gnu.org/gethelp/>
       Report any translation bugs to
       <https://translationproject.org/team/>

COPYRIGHT         top

       Copyright © 2026 Free Software Foundation, Inc.  License GPLv3+:
       GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
       This is free software: you are free to change and redistribute it.
       There is NO WARRANTY, to the extent permitted by law.

SEE ALSO         top

       dircolors(1)

       Full documentation <https://www.gnu.org/software/coreutils/dir>
       or available locally via: info '(coreutils) dir invocation'

COLOPHON         top

       This page is part of the coreutils (basic file, shell and text
       manipulation utilities) project.  Information about the project
       can be found at ⟨http://www.gnu.org/software/coreutils/⟩.  If you
       have a bug report for this manual page, see
       ⟨http://www.gnu.org/software/coreutils/⟩.  This page was obtained
       from the tarball coreutils-9.11.tar.xz fetched from
       ⟨http://ftp.gnu.org/gnu/coreutils/⟩ on 2026-05-24.  If you
       discover any rendering problems in this HTML version of the page,
       or you believe there is a better or more up-to-date source for the
       page, or you have corrections or improvements to the information
       in this COLOPHON (which is not part of the original manual page),
       send a mail to man-pages@man7.org

GNU coreutils 9.11              April 2026                         DIR(1)