ls command

Synopsis

ls [<path>]

Description

The ls command lists the contents of a directory in the VFS. Entries are sorted alphabetically. If no path is given, the current working directory is listed.

Directories are shown with the DIR prefix. Regular files show their size in bytes.

The filesystem must be mounted first using mount.

The ls command is also available as fs ls; see fs command.

path

absolute or relative path to list (default: current working directory)

Example

=> mount host 0:0 /mnt
=> ls /mnt
DIR          0 .
DIR          0 ..
DIR          0 subdir
            12 testfile.txt

Configuration

The ls command is available when CONFIG_CMD_VFS=y.

Return value

The return value $? is set to 0 (true) if the directory was listed, 1 (false) otherwise.