Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

ls

List folder contents.

Syntax

  • ls
  • ls(name)
  • res = ls()
  • res = ls(options)

Input argument

  • name - a string: file or directory name.
  • options - vary from system to system.

Output argument

  • res - On Windows, res is an m-by-n character array of names. m is the number of names and n is the number of characters in the longest name. On Unix plaftorms is a character vector of names separated by tab and space characters.

Description

ls is implemented by calling the native operating system's directory listing command—available options will vary from system to system.

Example

res = ls(nelsonroot())
if ~ispc()
  res = ls(nelsonroot(), '-l')
end

See also

dir, isdir, isfile.

History

VersionDescription
1.0.0initial version

Author

Allan CORNET