ftp lsftp ls

适用于: Windows Server (半年通道) ,Windows Server 2019,Windows Server 2016,Windows Server 2012 R2,Windows Server 2012Applies to: Windows Server (Semi-Annual Channel), Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012

显示远程计算机上的文件和子目录的缩写列表。Displays an abbreviated list of files and subdirectories from the remote computer.

语法Syntax

ls [<remotedirectory>] [<localfile>]

参数Parameters

参数Parameter 说明Description
[<remotedirectory>] 指定要查看其列表的目录。Specifies the directory for which you want to see a listing. 如果未指定目录,则使用远程计算机上的当前工作目录。If no directory is specified, the current working directory on the remote computer is used.
[<localfile>] 指定要在其中存储列表的本地文件。Specifies a local file in which to store the listing. 如果未指定本地文件,则结果将显示在屏幕上。If a local file is not specified, results are displayed on the screen.

示例Examples

若要显示远程计算机上的文件和子目录的缩写列表,请键入:To display an abbreviated list of files and subdirectories from the remote computer, type:

ls

若要获取远程计算机上的 dir1 的缩略目录列表,并将其保存到名为 dirlist.txt的本地文件中,请键入:To get an abbreviated directory listing of dir1 on the remote computer and save it in a local file called dirlist.txt, type:

ls dir1 dirlist.txt

其他参考Additional References