Documentation
¶
Overview ¶
Package ls implements the ls builtin command.
ls — list directory contents
Usage: ls [OPTION]... [FILE]...
List information about the FILEs (the current directory by default). Sort entries alphabetically by default.
Accepted flags:
-1
List one file per line. This is the default when output is not a
terminal (which is always the case in this shell).
-a, --all
Do not ignore entries starting with . (includes . and ..).
-A, --almost-all
Do not ignore entries starting with . but omit . and ..
-d, --directory
List directories themselves, not their contents.
-r, --reverse
Reverse order while sorting.
-S
Sort by file size, largest first.
-t
Sort by modification time, newest first.
-F, --classify
Append indicator (one of * / = @ |) to entries.
-p
Append / indicator to directories.
-R, --recursive
List subdirectories recursively.
-l
Use a long listing format. Simplified: mode, size, date, name.
NOTE: This is a simplified format compared to GNU ls — no
owner/group/link-count columns because syscall and os/user
packages are banned by the import allowlist.
-h, --human-readable
With -l, print sizes in human-readable format (e.g. 1K, 234M).
Exit codes:
0 All entries listed successfully. 1 At least one error occurred (missing file, permission denied, etc.). 1 Invalid usage (unrecognised flag, etc.).
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Cmd = builtins.Command{Name: "ls", MakeFlags: registerFlags}
Cmd is the ls builtin command descriptor.
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.