{
    "mode": "info",
    "parameter": "ls",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/info/ls/json",
    "generated": "2026-11-10T21:02:16Z",
    "sections": {
        "File: coreutils.info,  Node: ls invocation,  Next: dir invocation,  Up: Directory listing": {
            "content": "",
            "subsections": [
                {
                    "name": "10.1 'ls': List directory contents",
                    "content": ""
                }
            ]
        },
        "The 'ls' program lists information about files (of any type, including": {
            "content": "directories).  Options and file arguments can be intermixed arbitrarily,\nas usual.  Later options override earlier options that are incompatible.\n\nFor non-option command-line arguments that are directories, by\ndefault 'ls' lists the contents of directories, not recursively, and\nomitting files with names beginning with '.'.  For other non-option\narguments, by default 'ls' lists just the file name.  If no non-option\nargument is specified, 'ls' operates on the current directory, acting as\nif it had been invoked with a single argument of '.'.\n\nBy default, the output is sorted alphabetically, according to the\nlocale settings in effect.(1)  If standard output is a terminal, the\noutput is in columns (sorted vertically) and control characters are\noutput as question marks; otherwise, the output is listed one per line\nand control characters are output as-is.\n\nBecause 'ls' is such a fundamental program, it has accumulated many\noptions over the years.  They are described in the subsections below;\nwithin each section, options are listed alphabetically (ignoring case).",
            "subsections": []
        },
        "The division of options into the subsections is not absolute, since some": {
            "content": "options affect more than one aspect of 'ls''s operation.\n\nExit status:\n\n0 success\n1 minor problems  (e.g., failure to access a file or directory not\nspecified as a command line argument.  This happens when listing a\ndirectory in which entries are actively being removed or renamed.)\n2 serious trouble (e.g., memory exhausted, invalid option, failure\nto access a file or directory specified as a command line argument\nor a directory loop)\n\nAlso see *note Common options::.\n\n* Menu:\n\n* Which files are listed::\n* What information is listed::\n* Sorting the output::\n* General output formatting::\n* Formatting file timestamps::\n* Formatting the file names::\n\n---------- Footnotes ----------\n\n(1) If you use a non-POSIX locale (e.g., by setting 'LCALL' to\n'enUS'), then 'ls' may produce output that is sorted differently than\nyou're accustomed to.  In that case, set the 'LCALL' environment\nvariable to 'C'.\n",
            "subsections": []
        },
        "File: coreutils.info,  Node: Which files are listed,  Next: What information is listed,  Up: ls invocation": {
            "content": "",
            "subsections": []
        },
        "These options determine which files 'ls' lists information for.  By": {
            "content": "default, 'ls' lists files and the contents of any directories on the\ncommand line, except that in directories it ignores files whose names\nstart with '.'.\n\n'-a'\n'--all'\nIn directories, do not ignore file names that start with '.'.\n\n'-A'\n'--almost-all'\nIn directories, do not ignore all file names that start with '.';\nignore only '.' and '..'.  The '--all' ('-a') option overrides this\noption.\n\n'-B'\n'--ignore-backups'\nIn directories, ignore files that end with '~'.  This option is\nequivalent to '--ignore='*~' --ignore='.*~''.\n\n'-d'\n'--directory'\nList just the names of directories, as with other types of files,\nrather than listing their contents.  Do not follow symbolic links\nlisted on the command line unless the '--dereference-command-line'\n('-H'), '--dereference' ('-L'), or\n'--dereference-command-line-symlink-to-dir' options are specified.\n\n'-H'\n'--dereference-command-line'\nIf a command line argument specifies a symbolic link, show\ninformation for the file the link references rather than for the\nlink itself.\n\n'--dereference-command-line-symlink-to-dir'\nDo not dereference symbolic links, with one exception: if a command\nline argument specifies a symbolic link that refers to a directory,\nshow information for that directory rather than for the link\nitself.  This is the default behavior unless long format is being\nused or any of the following options is in effect: '--classify'\n('-F'), '--directory' ('-d'), '--dereference' ('-L'), or\n'--dereference-command-line' ('-H')).\n\n'--group-directories-first'\nGroup all the directories before the files and then sort the\ndirectories and the files separately using the selected sort key\n(see '--sort' option).  That is, this option specifies a primary\nsort key, and the '--sort' option specifies a secondary key.\nHowever, any use of '--sort=none' ('-U') disables this option\naltogether.\n\n'--hide=PATTERN'\nIn directories, ignore files whose names match the shell pattern\nPATTERN, unless the '--all' ('-a') or '--almost-all' ('-A') is also\ngiven.  This option acts like '--ignore=PATTERN' except that it has\nno effect if '--all' ('-a') or '--almost-all' ('-A') is also given.\n\nThis option can be useful in shell aliases.  For example, if 'lx'\nis an alias for 'ls --hide='*~'' and 'ly' is an alias for 'ls\n--ignore='*~'', then the command 'lx -A' lists the file 'README~'\neven though 'ly -A' would not.\n\n'-I PATTERN'\n'--ignore=PATTERN'\nIn directories, ignore files whose names match the shell pattern\n(not regular expression) PATTERN.  As in the shell, an initial '.'\nin a file name does not match a wildcard at the start of PATTERN.\nSometimes it is useful to give this option several times.  For\nexample,\n\n$ ls --ignore='.??*' --ignore='.[^.]' --ignore='#*'\n\nThe first option ignores names of length 3 or more that start with\n'.', the second ignores all two-character names that start with '.'\nexcept '..', and the third ignores names that start with '#'.\n\n'-L'\n'--dereference'\nWhen showing file information for a symbolic link, show information\nfor the file the link references rather than the link itself.\nHowever, even with this option, 'ls' still prints the name of the\nlink itself, not the name of the file that the link points to.\n\n'-R'\n'--recursive'\nList the contents of all directories recursively.\n",
            "subsections": []
        },
        "File: coreutils.info,  Node: What information is listed,  Next: Sorting the output,  Prev: Which files are listed,  Up: ls invocation": {
            "content": "",
            "subsections": []
        },
        "These options affect the information that 'ls' displays.  By default,": {
            "content": "only file names are shown.\n\n'--author'\nIn long format, list each file's author.  In GNU/Hurd, file authors\ncan differ from their owners, but in other operating systems the\ntwo are the same.\n\n'-D'\n'--dired'\nPrint an additional line after the main output:\n\n//DIRED// BEG1 END1 BEG2 END2 ...\n\nThe BEGN and ENDN are unsigned integers that record the byte\nposition of the beginning and end of each file name in the output.\nThis makes it easy for Emacs to find the names, even when they\ncontain unusual characters such as space or newline, without fancy\nsearching.\n\nIf directories are being listed recursively via '--recursive'\n('-R'), output a similar line with offsets for each subdirectory\nname:\n\n//SUBDIRED// BEG1 END1 ...\n\nFinally, output a line of the form:\n\n//DIRED-OPTIONS// --quoting-style=WORD\n\nwhere WORD is the quoting style (*note Formatting the file\nnames::).\n\nHere is an actual example:\n\n$ mkdir -p a/sub/deeper a/sub2\n$ touch a/f1 a/f2\n$ touch a/sub/deeper/file\n$ ls -gloRF --dired a\na:\ntotal 8\n-rw-r--r-- 1    0 Jun 10 12:27 f1\n-rw-r--r-- 1    0 Jun 10 12:27 f2\ndrwxr-xr-x 3 4096 Jun 10 12:27 sub/\ndrwxr-xr-x 2 4096 Jun 10 12:27 sub2/\n\na/sub:\ntotal 4\ndrwxr-xr-x 2 4096 Jun 10 12:27 deeper/\n\na/sub/deeper:\ntotal 0\n-rw-r--r-- 1 0 Jun 10 12:27 file\n\na/sub2:\ntotal 0\n//DIRED// 48 50 84 86 120 123 158 162 217 223 282 286\n//SUBDIRED// 2 3 167 172 228 240 290 296\n//DIRED-OPTIONS// --quoting-style=literal\n\nThe pairs of offsets on the '//DIRED//' line above delimit these\nnames: 'f1', 'f2', 'sub', 'sub2', 'deeper', 'file'.  The offsets on\nthe '//SUBDIRED//' line delimit the following directory names: 'a',\n'a/sub', 'a/sub/deeper', 'a/sub2'.\n\nHere is an example of how to extract the fifth entry name,\n'deeper', corresponding to the pair of offsets, 222 and 228:\n\n$ ls -gloRF --dired a > out\n$ dd bs=1 skip=222 count=6 < out 2>/dev/null; echo\ndeeper\n\nAlthough the listing above includes a trailing slash for the\n'deeper' entry, the offsets select the name without the trailing\nslash.  However, if you invoke 'ls' with '--dired' ('-D') along\nwith an option like '--escape' ('-b') and operate on a file whose\nname contains special characters, the backslash is included:\n\n$ touch 'a b'\n$ ls -blog --dired 'a b'\n-rw-r--r-- 1 0 Jun 10 12:28 a\\ b\n//DIRED// 30 34\n//DIRED-OPTIONS// --quoting-style=escape\n\nIf you use a quoting style like '--quoting-style=c' ('-Q') that\nadds quote marks, then the offsets include the quote marks.  So\nbeware that the user may select the quoting style via the\nenvironment variable 'QUOTINGSTYLE'.  Hence, applications using\n'--dired' should either specify an explicit\n'--quoting-style=literal' ('-N') option on the command line, or\nelse be prepared to parse the escaped names.\n\nThe '--dired' ('-D') option has well-defined behavior only when\nlong format is in effect and hyperlinks are disabled (e.g.,\n'--hyperlink=none').\n\n'--full-time'\nProduce long format, and list times in full.  It is equivalent to\nusing '--format=long' ('-l') with '--time-style=full-iso' (*note\nFormatting file timestamps::).\n\n'-g'\nProduce long format, but omit owner information.\n\n'-G'\n'--no-group'\nInhibit display of group information in long format.  (This is the\ndefault in some non-GNU versions of 'ls', so we provide this option\nfor compatibility.)\n\n'-h'\n'--human-readable'\nAppend a size letter to each size, such as 'M' for mebibytes.\nPowers of 1024 are used, not 1000; 'M' stands for 1,048,576 bytes.\nThis option is equivalent to '--block-size=human-readable'.  Use\nthe '--si' option if you prefer powers of 1000.\n\n'-i'\n'--inode'\nPrint the inode number (also called the file serial number and\nindex number) of each file to the left of the file name.  (This\nnumber uniquely identifies each file within a particular file\nsystem.)\n\n'-l'\n'--format=long'\n'--format=verbose'\nProduce long format.  In addition to the name of each file, print\nthe file type, file mode bits, number of hard links, owner name,\ngroup name, size, and timestamp (*note Formatting file\ntimestamps::), normally the modification timestamp (the mtime,\n*note File timestamps::).  If the owner or group name cannot be\ndetermined, print the owner or group ID instead, right-justified as\na cue that it is a number rather than a textual name.  Print\nquestion marks for other information that cannot be determined.\n\nNormally the size is printed as a byte count without punctuation,\nbut this can be overridden (*note Block size::).  For example,\n'--human-readable' ('-h') prints an abbreviated, human-readable\ncount, and '--block-size=\"'1\"' prints a byte count with the\nthousands separator of the current locale.\n\nFor each directory that is listed, preface the files with a line\n'total BLOCKS', where BLOCKS is the file system allocation for all\nfiles in that directory.  The block size currently defaults to 1024\nbytes, but this can be overridden (*note Block size::).  The BLOCKS\ncomputed counts each hard link separately; this is arguably a\ndeficiency.\n\nThe file type is one of the following characters:\n\n'-'\nregular file\n'b'\nblock special file\n'c'\ncharacter special file\n'C'\nhigh performance (\"contiguous data\") file\n'd'\ndirectory\n'D'\ndoor (Solaris)\n'l'\nsymbolic link\n'M'\noff-line (\"migrated\") file (Cray DMF)\n'n'\nnetwork special file (HP-UX)\n'p'\nFIFO (named pipe)\n'P'\nport (Solaris)\n's'\nsocket\n'?'\nsome other file type\n\nThe file mode bits listed are similar to symbolic mode\nspecifications (*note Symbolic Modes::).  But 'ls' combines\nmultiple bits into the third character of each set of permissions\nas follows:\n\n's'\nIf the set-user-ID or set-group-ID bit and the corresponding\nexecutable bit are both set.\n\n'S'\nIf the set-user-ID or set-group-ID bit is set but the\ncorresponding executable bit is not set.\n\n't'\nIf the restricted deletion flag or sticky bit, and the\nother-executable bit, are both set.  The restricted deletion\nflag is another name for the sticky bit.  *Note Mode\nStructure::.\n\n'T'\nIf the restricted deletion flag or sticky bit is set but the\nother-executable bit is not set.\n\n'x'\nIf the executable bit is set and none of the above apply.\n\n'-'\nOtherwise.\n\nFollowing the file mode bits is a single character that specifies\nwhether an alternate access method such as an access control list\napplies to the file.  When the character following the file mode\nbits is a space, there is no alternate access method.  When it is a\nprinting character, then there is such a method.\n\nGNU 'ls' uses a '.' character to indicate a file with a security\ncontext, but no other alternate access method.\n\nA file with any other combination of alternate access methods is\nmarked with a '+' character.\n\n'-n'\n'--numeric-uid-gid'\nProduce long format, but display right-justified numeric user and\ngroup IDs instead of left-justified owner and group names.\n\n'-o'\nProduce long format, but omit group information.  It is equivalent\nto using '--format=long' ('-l') with '--no-group' ('-G').\n\n'-s'\n'--size'\nPrint the file system allocation of each file to the left of the\nfile name.  This is the amount of file system space used by the\nfile, which is usually a bit more than the file's size, but it can\nbe less if the file has holes.\n\nNormally the allocation is printed in units of 1024 bytes, but this\ncan be overridden (*note Block size::).\n\nFor files that are NFS-mounted from an HP-UX system to a BSD\nsystem, this option reports sizes that are half the correct values.\nOn HP-UX systems, it reports sizes that are twice the correct\nvalues for files that are NFS-mounted from BSD systems.  This is\ndue to a flaw in HP-UX; it also affects the HP-UX 'ls' program.\n\n'--si'\nAppend an SI-style abbreviation to each size, such as 'M' for\nmegabytes.  Powers of 1000 are used, not 1024; 'M' stands for\n1,000,000 bytes.  This option is equivalent to '--block-size=si'.\nUse the '-h' or '--human-readable' option if you prefer powers of\n1024.\n\n'-Z'\n'--context'\nDisplay the SELinux security context or '?' if none is found.  In\nlong format, print the security context to the left of the size\ncolumn.\n",
            "subsections": []
        },
        "File: coreutils.info,  Node: Sorting the output,  Next: General output formatting,  Prev: What information is listed,  Up: ls invocation": {
            "content": "",
            "subsections": []
        },
        "These options change the order in which 'ls' sorts the information it": {
            "content": "outputs.  By default, sorting is done by character code (e.g., ASCII\norder).\n\n'-c'\n'--time=ctime'\n'--time=status'\nIn long format, print the status change timestamp (the ctime)\ninstead of the mtime.  When sorting by time or when not using long\nformat, sort according to the ctime.  *Note File timestamps::.\n\n'-f'\nProduce an unsorted directory listing.  This is equivalent to the\ncombination of '--all' ('-a'), '--sort=none' ('-U'), '-1',\n'--color=none', and '--hyperlink=none', while also disabling any\nprevious use of '--size' ('-s').\n\n'-r'\n'--reverse'\nReverse whatever the sorting method is - e.g., list files in\nreverse alphabetical order, youngest first, smallest first, or\nwhatever.  This option has no effect when '--sort=none' ('-U') is\nin effect.\n\n'-S'\n'--sort=size'\nSort by file size, largest first.\n\n'-t'\n'--sort=time'\nSort by modification timestamp (mtime) by default, newest first.\nThe timestamp to order by can be changed with the '--time' option.\n*Note File timestamps::.\n\n'-u'\n'--time=atime'\n'--time=access'\n'--time=use'\nIn long format, print the last access timestamp (the atime).  When\nsorting by time or when not using long format, sort according to\nthe atime.  *Note File timestamps::.\n\n'--time=mtime'\n'--time=modification'\nThis is the default timestamp display and sorting mode.  In long\nformat, print the last data modification timestamp (the mtime).\nWhen sorting by time or when not using long format, sort according\nto the mtime.  *Note File timestamps::.\n\n'--time=birth'\n'--time=creation'\nIn long format, print the file creation timestamp if available,\nfalling back to the file modification timestamp (mtime) if not.\nWhen sorting by time or when not using long format, sort according\nto the birth time.  *Note File timestamps::.\n\n'-U'\n'--sort=none'\nDo not sort; list the files in whatever order they are stored in\nthe directory.  (Do not do any of the other unrelated things that\n'-f' does.)  This can be useful when listing large directories,\nwhere sorting can take some time.\n\n'-v'\n'--sort=version'\nSort by version name and number, lowest first.  It behaves like a\ndefault sort, except that each sequence of decimal digits is\ntreated numerically as an index/version number.  *Note Version sort\nordering::.\n\n'--sort=width'\nSort by printed width of file names.  This can be useful with the\n'--format=vertical' ('-C') output format, to most densely display\nthe listed files.\n\n'-X'\n'--sort=extension'\nSort directory contents alphabetically by file extension\n(characters after the last '.'); files with no extension are sorted\nfirst.\n",
            "subsections": []
        },
        "File: coreutils.info,  Node: General output formatting,  Next: Formatting file timestamps,  Prev: Sorting the output,  Up: ls invocation": {
            "content": "These options affect the appearance of the overall output.\n\n'--format=single-column'\nList one file name per line, with no other information.  This is\nthe default for 'ls' when standard output is not a terminal.  See\nalso the '--escape' ('-b'), '--hide-control-chars' ('-q'), and\n'--zero' options to disambiguate output of file names containing\nnewline characters.\n\n'-1'\nList one file per line.  This is like '--format=single-column'\nexcept that it has no effect if long format is also in effect.\n\n'-C'\n'--format=vertical'\nList files in columns, sorted vertically, with no other\ninformation.  This is the default for 'ls' if standard output is a\nterminal.  It is always the default for the 'dir' program.  GNU\n'ls' uses variable width columns to display as many files as\npossible in the fewest lines.\n\n'--color [=WHEN]'\nSpecify whether to use color for distinguishing file types; WHEN\nmay be omitted, or one of:\n* none - Do not use color at all.  This is the default.\n* auto - Only use color if standard output is a terminal.\n* always - Always use color.\nSpecifying '--color' and no WHEN is equivalent to '--color=always'.\nIf piping a colored listing through a pager like 'less', use the\npager's '-R' option to pass the color codes to the terminal.\n\nUsing the '--color' option may incur a noticeable performance\npenalty when run in a large directory, because the default settings\nrequire that 'ls' 'stat' every single file it lists.  However, if\nyou would like most of the file-type coloring but can live without\nthe other coloring options (e.g., executable, orphan, sticky,\nother-writable, capability), use 'dircolors' to set the 'LSCOLORS'\nenvironment variable like this,\neval $(dircolors -p | perl -pe \\\n's/^((CAP|S[ET]|O[TR]|M|E)\\w+).*/$1 00/' | dircolors -)\nand on a 'dirent.dtype'-capable file system, 'ls' will perform\nonly one 'stat' call per command line argument.\n\n'-F'\n'--classify [=WHEN]'\n'--indicator-style=classify'\nAppend a character to each file name indicating the file type.\nAlso, for regular files that are executable, append '*'.  The file\ntype indicators are '/' for directories, '@' for symbolic links,\n'|' for FIFOs, '=' for sockets, '>' for doors, and nothing for\nregular files.  WHEN may be omitted, or one of:\n* none - Do not classify.  This is the default.\n* auto - Only classify if standard output is a terminal.\n* always - Always classify.\nSpecifying '--classify' and no WHEN is equivalent to\n'--classify=always'.  Do not follow symbolic links listed on the\ncommand line unless the '--dereference-command-line' ('-H'),\n'--dereference' ('-L'), or\n'--dereference-command-line-symlink-to-dir' options are specified.\n\n'--file-type'\n'--indicator-style=file-type'\nAppend a character to each file name indicating the file type.\nThis is like '--classify' ('-F', except that executables are not\nmarked.\n\n'--hyperlink [=WHEN]'\nOutput codes recognized by some terminals to link to files using\nthe 'file://' URI format.  WHEN may be omitted, or one of:\n* none - Do not use hyperlinks at all.  This is the default.\n* auto - Only use hyperlinks if standard output is a terminal.\n* always - Always use hyperlinks.\nSpecifying '--hyperlink' and no WHEN is equivalent to\n'--hyperlink=always'.\n\n'--indicator-style=WORD'\nAppend a character indicator with style WORD to entry names, as\nfollows:\n\n'none'\nDo not append any character indicator; this is the default.\n'slash'\nAppend '/' for directories.  This is the same as the '-p'\noption.\n'file-type'\nAppend '/' for directories, '@' for symbolic links, '|' for\nFIFOs, '=' for sockets, and nothing for regular files.  This\nis the same as the '--file-type' option.\n'classify'\nAppend '*' for executable regular files, otherwise behave as\nfor 'file-type'.  This is the same as the '--classify' ('-F')\noption.\n\n'-k'\n'--kibibytes'\nSet the default block size to its normal value of 1024 bytes,\noverriding any contrary specification in environment variables\n(*note Block size::).  If '--block-size', '--human-readable'\n('-h'), or '--si' options are used, they take precedence even if\n'--kibibytes' ('-k') is placed after\n\nThe '--kibibytes' ('-k') option affects the per-directory block\ncount written in long format, and the file system allocation\nwritten by the '--size' ('-s') option.  It does not affect the file\nsize in bytes that is written in long format.\n\n'-m'\n'--format=commas'\nList files horizontally, with as many as will fit on each line,\nseparated by ', ' (a comma and a space), and with no other\ninformation.\n\n'-p'\n'--indicator-style=slash'\nAppend a '/' to directory names.\n\n'-x'\n'--format=across'\n'--format=horizontal'\nList the files in columns, sorted horizontally.\n\n'-T COLS'\n'--tabsize=COLS'\nAssume that each tab stop is COLS columns wide.  The default is 8.\n'ls' uses tabs where possible in the output, for efficiency.  If\nCOLS is zero, do not use tabs at all.\n\nSome terminal emulators might not properly align columns to the\nright of a TAB following a non-ASCII byte.  You can avoid that\nissue by using the '-T0' option or put 'TABSIZE=0' in your\nenvironment, to tell 'ls' to align using spaces, not tabs.\n\nIf you set a terminal's hardware tabs to anything other than the\ndefault, you should also use a '--tabsize' option or 'TABSIZE'\nenvironment variable either to match the hardware tabs, or to\ndisable the use of hardware tabs.  Otherwise, the output of 'ls'\nmay not line up.  For example, if you run the shell command 'tabs\n-4' to set hardware tabs to every four columns, you should also run\n'export TABSIZE=4' or 'export TABSIZE=0', or use the corresponding\n'--tabsize' options.\n\n'-w COLS'\n'--width=COLS'\nAssume the screen is COLS columns wide.  The default is taken from\nthe terminal settings if possible; otherwise the environment\nvariable 'COLUMNS' is used if it is set; otherwise the default is\n80.  With a COLS value of '0', there is no limit on the length of\nthe output line, and that single output line will be delimited with\nspaces, not tabs.\n\n'--zero'\nOutput a zero byte (ASCII NUL) at the end of each line, rather than\na newline.  This option enables other programs to parse the output\neven when that output would contain data with embedded newlines.\nThis option is incompatible with the '--dired' ('-D') option.  This\noption also implies the options '--show-control-chars', '-1',\n'--color=none', and '--quoting-style=literal' ('-N').\n",
            "subsections": []
        },
        "File: coreutils.info,  Node: Formatting file timestamps,  Next: Formatting the file names,  Prev: General output formatting,  Up: ls invocation": {
            "content": "",
            "subsections": []
        },
        "By default, file timestamps are listed in abbreviated form, using a date": {
            "content": "like 'Mar 30  2020' for non-recent timestamps, and a date-without-year\nand time like 'Mar 30 23:45' for recent timestamps.  This format can\nchange depending on the current locale as detailed below.\n\nA timestamp is considered to be \"recent\" if it is less than six\nmonths old, and is not dated in the future.  If a timestamp dated today\nis not listed in recent form, the timestamp is in the future, which\nmeans you probably have clock skew problems which may break programs\nlike 'make' that rely on file timestamps.  *Note File timestamps::.\n\nTimestamps are listed according to the time zone rules specified by\nthe 'TZ' environment variable, or by the system default rules if 'TZ' is\nnot set.  *Note Specifying the Time Zone with 'TZ': (libc)TZ Variable.\n\nThe following option changes how file timestamps are printed.\n\n'--time-style=STYLE'\nList timestamps in style STYLE.  The STYLE should be one of the\nfollowing:\n\n'+FORMAT'\nList timestamps using FORMAT, where FORMAT is interpreted like\nthe format argument of 'date' (*note date invocation::).  For\nexample, '--time-style=\"+%Y-%m-%d %H:%M:%S\"' causes 'ls' to\nlist timestamps like '2020-03-30 23:45:56'.  As with 'date',\nFORMAT's interpretation is affected by the 'LCTIME' locale\ncategory.\n\nIf FORMAT contains two format strings separated by a newline,\nthe former is used for non-recent files and the latter for\nrecent files; if you want output columns to line up, you may\nneed to insert spaces in one of the two formats.\n\n'full-iso'\nList timestamps in full using ISO 8601-like date, time, and\ntime zone components with nanosecond precision, e.g.,\n'2020-07-21 23:45:56.477817180 -0400'.  This style is\nequivalent to '+%Y-%m-%d %H:%M:%S.%N %z'.\n\nThis is useful because the time output includes all the\ninformation that is available from the operating system.  For\nexample, this can help explain 'make''s behavior, since GNU\n'make' uses the full timestamp to determine whether a file is\nout of date.\n\n'long-iso'\nList ISO 8601 date and time components with minute precision,\ne.g., '2020-03-30 23:45'.  These timestamps are shorter than\n'full-iso' timestamps, and are usually good enough for\neveryday work.  This style is equivalent to '+%Y-%m-%d %H:%M'.\n\n'iso'\nList ISO 8601 dates for non-recent timestamps (e.g.,\n'2020-03-30 '), and ISO 8601-like month, day, hour, and minute\nfor recent timestamps (e.g., '03-30 23:45').  These timestamps\nare uglier than 'long-iso' timestamps, but they carry nearly\nthe same information in a smaller space and their brevity\nhelps 'ls' output fit within traditional 80-column output\nlines.  The following two 'ls' invocations are equivalent:\n\nnewline='\n'\nls -l --time-style=\"+%Y-%m-%d $newline%m-%d %H:%M\"\nls -l --time-style=\"iso\"\n\n'locale'\nList timestamps in a locale-dependent form.  For example, a\nFrench locale might list non-recent timestamps like '30\nmars   2020' and recent timestamps like '30 mars  23:45'.\nLocale-dependent timestamps typically consume more space than\n'iso' timestamps and are harder for programs to parse because\nlocale conventions vary so widely, but they are easier for\nmany people to read.\n\nThe 'LCTIME' locale category specifies the timestamp format.\nThe default POSIX locale uses timestamps like 'Mar 30  2020'\nand 'Mar 30 23:45'; in this locale, the following two 'ls'\ninvocations are equivalent:\n\nnewline='\n'\nls -l --time-style=\"+%b %e  %Y$newline%b %e %H:%M\"\nls -l --time-style=\"locale\"\n\nOther locales behave differently.  For example, in a German\nlocale, '--time-style=\"locale\"' might be equivalent to\n'--time-style=\"+%e. %b %Y $newline%e. %b %H:%M\"' and might\ngenerate timestamps like '30. Ma\"r 2020 ' and '30. Ma\"r 23:45'.\n\n'posix-STYLE'\nList POSIX-locale timestamps if the 'LCTIME' locale category\nis POSIX, STYLE timestamps otherwise.  For example, the\n'posix-long-iso' style lists timestamps like 'Mar 30  2020'\nand 'Mar 30 23:45' when in the POSIX locale, and like\n'2020-03-30 23:45' otherwise.\n\nYou can specify the default value of the '--time-style' option with\nthe environment variable 'TIMESTYLE'; if 'TIMESTYLE' is not set the\ndefault style is 'locale'.  GNU Emacs 21.3 and later use the '--dired'\noption and therefore can parse any date format, but if you are using",
            "subsections": []
        },
        "Emacs 21.1 or 21.2 and specify a non-POSIX locale you may need to set": {
            "content": "'TIMESTYLE=\"posix-long-iso\"'.\n\nTo avoid certain denial-of-service attacks, timestamps that would be\nlonger than 1000 bytes may be treated as errors.\n",
            "subsections": []
        },
        "File: coreutils.info,  Node: Formatting the file names,  Prev: Formatting file timestamps,  Up: ls invocation": {
            "content": "These options change how file names themselves are printed.\n\n'-b'\n'--escape'\n'--quoting-style=escape'\nQuote nongraphic characters in file names using alphabetic and\noctal backslash sequences like those used in C.\n\n'-N'\n'--literal'\n'--quoting-style=literal'\nDo not quote file names.  However, with 'ls' nongraphic characters\nare still printed as question marks if the output is a terminal and\nyou do not specify the '--show-control-chars' option.\n\n'-q'\n'--hide-control-chars'\nPrint question marks instead of nongraphic characters in file\nnames.  This is the default if the output is a terminal and the\nprogram is 'ls'.\n\n'-Q'\n'--quote-name'\n'--quoting-style=c'\nEnclose file names in double quotes and quote nongraphic characters\nas in C.\n\n'--quoting-style=WORD'\nUse style WORD to quote file names and other strings that may\ncontain arbitrary characters.  The WORD should be one of the\nfollowing:\n\n'literal'\nOutput strings as-is; this is the same as the '--literal'\n('-N') option.\n'shell'\nQuote strings for the shell if they contain shell\nmetacharacters or would cause ambiguous output.  The quoting\nis suitable for POSIX-compatible shells like 'bash', but it\ndoes not always work for incompatible shells like 'csh'.\n'shell-always'\nQuote strings for the shell, even if they would normally not\nrequire quoting.\n'shell-escape'\nLike 'shell', but also quoting non-printable characters using\nthe POSIX proposed '$''' syntax suitable for most shells.\n'shell-escape-always'\nLike 'shell-escape', but quote strings even if they would\nnormally not require quoting.\n'c'\nQuote strings as for C character string literals, including\nthe surrounding double-quote characters; this is the same as\nthe '--quote-name' ('-Q') option.\n'escape'\nQuote strings as for C character string literals, except omit\nthe surrounding double-quote characters; this is the same as\nthe '--escape' ('-b') option.\n'clocale'\nQuote strings as for C character string literals, except use\nsurrounding quotation marks appropriate for the locale.\n'locale'\nQuote strings as for C character string literals, except use\nsurrounding quotation marks appropriate for the locale, and\nquote 'like this' instead of \"like this\" in the default C\nlocale.  This looks nicer on many displays.\n\nYou can specify the default value of the '--quoting-style' option\nwith the environment variable 'QUOTINGSTYLE'.  If that environment\nvariable is not set, the default value is 'shell-escape' when the\noutput is a terminal, and 'literal' otherwise.\n\n'--show-control-chars'\nPrint nongraphic characters as-is in file names.  This is the\ndefault unless the output is a terminal and the program is 'ls'.\n",
            "subsections": []
        }
    },
    "flags": [],
    "examples": [],
    "see_also": []
}