Package osh :: Package command :: Module ls
[frames] | no frames]

Module ls

source code

ls [-01rfds] [FILENAME_PATTERN ...]

Generates a stream of objects of type osh.file.File. Each FILENAME_PATTERN is expanded as a Unix "glob" pattern. If no FILENAME_PATTERNs are specified, then the files in the current directory are output. If -0 (that's a zero) is specified, then only files matching the specified FILENAME_PATTERNs are output; any qualifying directories are not explored. If -1 (that's the digit one, not the letter L) is specified, then files are listed and directories are expanded to one level. If -r is specified, then directories are recursively explored. At most one of these flags may be specified. If none of these flags are specified, then the behavior defaults to -1.

If -f is specified, files are listed. If -d is specified, directories are listed. If -s is specified, symlinks are listed. Combinations of these flags are permitted. If none of these flags are specified, then files, directories and symlinks are listed.

Symlinks to directories are not explored.

Functions
 
ls(paths, depth_0=False, depth_1=False, recursive=False, file=False, dir=False, link=False)
Generates a stream of objects of type osh.file.File.
source code
Function Details

ls(paths, depth_0=False, depth_1=False, recursive=False, file=False, dir=False, link=False)

source code 

Generates a stream of objects of type osh.file.File. paths may be a single path or a sequence of paths Each path in paths is expanded as a Unix "glob" pattern. If no path is specified, then the files in the current directory are output. If depth_0 is True, then only files matching the specified pathss are output; any qualifying directories are not explored. If depth_1 is True, then behavior is as for depth_0 except that files in qualifying directories are output as well. If recursive is True, then directories are recursively explored. At most one of the last three arguments may be True. If all are False, then depth_1 behavior is obtained. Files are listed if and only if file is true. Directories are listed if and only if dir is true. Symlinks are listed if and only if link is true. If file, dir and link are all false, then files, directories and symlinks are listed. Symlinks to directories are not explored.