Linux Method of Viewing File Status of Remote Server

  • 2021-06-28 09:58:57
  • OfStack

As follows:

The test command determines whether a file exists:


ssh usrname@remotehost "test -e remote_file_path"

The stat command gets the timestamp of the last modification to the file:


ssh usrname@remotehost "stat -c %Y remote_file_path"

Related articles: