I have a requirement where I need to do SFTP connection to remote server, get the size of the file on remote server and depending on the size, i need to get the file onto local server. Is there any command in SFTP to get the size of the file.
If you'd like the size output to be human readable, try: ls -lah
You can get the file size of the remote files using the ls
command by passing parameters.
To get Size of the file pass ls -l
To get Size of the file (HIdden files included) ls -al
To get it in human readable format pass ls -lh
or ls -alh
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With