dir (SFTP client view)

Function

The dir command displays the list of directories and files in the specified directory of the remote machine.

By default, the details about the current directory are displayed.

Format

dir [ remote-directory [ local-filename ] ]

Parameters

Parameter Description Value
remote-directory

Specifies the remote directory name.

The value is a string of 1 to 255 case-sensitive characters without a blank space.

local-filename

Specifies the saved local file name.

The value is a string of 1 to 255 case-sensitive characters without a blank space.

Views

SFTP client view

Default Level

3: Management level

Task Name and Operations

Task Name Operations
ssh-client execute

Usage Guidelines

Usage Scenario

You can use this command to display the contents of the remote directory. To save the result in the local file, you need to specify the file name.

Precautions

The Cfcard has internal partitions. The remaining space information shown in the dir cfcard: command output greatly differs from that shown in the dir cfcard:/logfile/ command output. Before you install the target system software, run the dir cfcard: command to verify whether the remaining space is sufficient.

Example

# Query the directory names.
<HUAWEI> system-view
[~HUAWEI] sftp 1.1.1.1
Trying 1.1.1.1 ...
Press CTRL + K to abort
Connected to 1.1.1.1.
220 VRPV8 SFTP service ready.
User(1.1.1.1:(none)):sftp
331 Password required for sftp.
Enter password:
sftp-client> dir
# Query the directories of FTP server named as new_folder.
<HUAWEI> system-view
[~HUAWEI] sftp 1.1.1.1
Trying 1.1.1.1 ...
Press CTRL + K to abort
Connected to 1.1.1.1.
220 VRPV8 SFTP service ready.
User(1.1.1.1:(none)):sftp
331 Password required for sftp.
Enter password:
sftp-client> dir new_folder
# Query the new_folder and save the query result in the file output.txt.
<HUAWEI> system-view
[~HUAWEI] sftp 1.1.1.1
Trying 1.1.1.1 ...
Press CTRL + K to abort
Connected to 1.1.1.1.
220 VRPV8 SFTP service ready.
User(1.1.1.1:(none)):sftp
331 Password required for sftp.
Enter password:
sftp-client> dir new_folder output.txt
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >