Search code examples
linuxsftpls

Command to list file and show its timestamp with milliseconds in sftp command


Normally in Linux or Unix, I will use following command to list the files's timestamp in milliseconds:

ls -la --time-style=full-iso file1.txt
ls -la --time-style=full-iso file2.txt
ls --full-time

How if I want to do it in sftp command? Does sftp command support this?


Solution

  • If you are referring to OpenSSH sftp command, then there's indeed no support for milliseconds.

    As of OpenSSH 8.4, its SFTP implementation supports SFTP version 3 only, which does not support milliseconds. There's no active development in SFTP in OpenSSH, so it's unlikely it changes any time soon.


    Even if you pick another SFTP client that supports milliseconds, you also must have a support for milliseconds on SFTP server. But majority of SFTP servers are OpenSSH again.