The dir and ls commands display a list of specified files that are stored on the SFTP server.
Parameter | Description | Value |
---|---|---|
-l | Displays detailed information about all files and directories in a specified directory. | - |
-a | Displays names of all files and directories in a specified directory. | - |
remote-directory | Specifies the name of a directory on the SFTP server. | The value is a string of 1 to 64 case-insensitive characters without spaces. |
# Display a list of files in the test directory of the SFTP server.
<HUAWEI> system-view [HUAWEI] sftp 10.137.217.201 Please input the username:admin Trying 10.137.217.201 ... Press CTRL+K to abort Connected to 10.137.217.201 ... Enter password:
sftp-client> dir test drwxrwxrwx 1 noone nogroup 0 Mar 24 2012 . drwxrwxrwx 1 noone nogroup 0 Mar 29 2012 .. -rwxrwxrwx 1 noone nogroup 0 Mar 24 2012 yourtest -rwxrwxrwx 1 noone nogroup 5736 Mar 24 2012 backup.txt -rwxrwxrwx 1 noone nogroup 5736 Mar 24 2012 backup1.txt sftp-client> dir -a test . .. yourtest backup.txt backup1.txt sftp-client> ls test drwxrwxrwx 1 noone nogroup 0 Mar 24 2012 . drwxrwxrwx 1 noone nogroup 0 Mar 29 2012 .. -rwxrwxrwx 1 noone nogroup 0 Mar 24 2012 yourtest -rwxrwxrwx 1 noone nogroup 5736 Mar 24 2012 backup.txt -rwxrwxrwx 1 noone nogroup 5736 Mar 24 2012 backup1.txt sftp-client> ls -a test . .. yourtest backup.txt backup1.txt