How to get the latest folder that contains a specific file of interest in Linux and download that file using Paramiko in Python?
问题 I am trying to scp a specific file from a remote server to my local machine using Paramiko in Python 3. Background: There is a directory mydir on the destination machine 198.18.2.2 that contains many timestamp directories that start with the name 2020... Destination machine: 198.18.2.2 Source Machine: 198.18.1.1 So far I have managed to construct the command to be executed as follows - cd "$(ls -1d /mydir/20* | tail -1)"; scp -o StrictHostKeyChecking=no email_summary.log root@198.18.1.1: