简体   繁体   English

在Linux中下载文件之前如何知道文件的总大小

[英]How to know the total size of a file before downloading it in linux

I have two linux machines machine1 and machine2(ftp server). 我有两台Linux机器machine1和machine2(ftp服务器)。

I am going to download a file from machine2 to machine1. 我将文件从machine2下载到machine1。 The file is located in machine2/root/vdo.mp4 , 该文件位于machine2 / root / vdo.mp4中

and i need the total size of this file before the download begins. 在下载开始之前,我需要此文件的总大小。

Is there any way to achive this. 有什么办法可以做到这一点。

UPDATE : How i got the total file size. 更新:我如何获得总文件大小。 I ran below command : 我在命令下面运行:

du -hs FILE_NAME

FTP supports getting the total size of a file before download FTP支持在下载之前获取文件的总大小

SIZE filename

The SIZE command (Return the size of a file) is defined in RFC 3659. SIZE命令(返回文件的大小)在RFC 3659中定义。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM