List directory contents.

Synopsis

ls [OPTION]... [FILE]...

Description

List information about files and directories. By default, lists the contents of the current directory in alphabetical order. Runs in the just-bash WASM shell inside SLICC, operating on a virtual filesystem backed by IndexedDB.

Options

-a, --all Do not ignore entries starting with .

-A, --almost-all Do not list implied . and ..

-d, --directory List directories themselves, not their contents.

-h, --human-readable With -l, print sizes like 1K 234M 2G etc.

-l Use a long listing format.

-r, --reverse Reverse order while sorting.

-R, --recursive List subdirectories recursively.

-S Sort by file size, largest first.

-t Sort by modification time, newest first.

-1 List one file per line.

--help Display help and exit.

Examples

$ ls

List files in the current directory.

$ ls -la /home/user

Long listing of all files including hidden ones.

$ ls -lhS

Long listing sorted by size with human-readable sizes.

$ ls -R src/

Recursively list all files under src/.

Notes

Operates on the SLICC virtual filesystem (LightningFS/IndexedDB). File permissions shown in long format are simulated (directories show drwxr-xr-x, files show -rw-r--r--). Owner and group are always displayed as "user user". Glob patterns in arguments (*, ?, [...]) are supported. No color output.

See Also

find, tree, stat, du