# ls - [Command Function](#section6538163771614) - [Syntax](#section45881743111616) - [Parameter Description](#section17528148171617) - [Usage](#section041212533166) - [Example](#section986105716167) - [Output](#section2036124918592) ## Command Function This command is used to display the content of a specified directory. ## Syntax ls \[_path_\] ## Parameter Description **Table 1** Parameters

Parameter

Description

Value Range

path

If path is left blank, the content of the current directory is displayed.

If the path value is an invalid file name, the following failure message is displayed:

ls error: No such directory

If the path value is a valid directory, the content of this directory is displayed.

  • Left blank
  • A valid directory
## Usage - This command can be used to display the content of the current directory. - This command can also display the size of a file. - The **ls** command with the **proc** directory passed cannot calculate the file size and **0** is displayed in the command output. ## Example Enter **ls**. ## Output **Figure 1** Viewing content of the current directory ![](figure/viewing-content-of-the-current-directory.png "viewing-content-of-the-current-directory")