ls

Displays information and contents of file(s) or directories.

Syntax

ls(f)

R = ls(...)

R = ls(options, filenames)

Inputs

options
System dependent argument for specifying a directory listing. On Windows operating systems, options correspond to the syntax of the dir system command. On Linux and Unix operating systems, options corresponds to the syntax of the ls system command.
Type: string
filenames
Optional path to file(s) or directories. Path(s) may contain wildcard characters. If no path is specified, the contents of the current working directory are listed.
Type: string

Outputs

R (optional)
Optional output variable which returns the contents of the path(s) as a string.
Type: string

Examples

Listing of the current working directory:
ls

Directory [C:\Files\Examples]
[.]
[..]
File_1.pdf
Example.pdf
...
Textfile.txt
    17 File(s)
    2 Dir(s)
Listing of the contents of a directory with wild cards:
R = ls('C:\Files\Examples\*File*')

R = Directory [C:\Files\Examples]
File_1.pdf
    1 File(s)
    0 Dir(s)