Skip to content

Instantly share code, notes, and snippets.

@ozgun
Created December 11, 2015 12:28
Show Gist options
  • Save ozgun/5d7e8c0f3e229f2fd92f to your computer and use it in GitHub Desktop.
Save ozgun/5d7e8c0f3e229f2fd92f to your computer and use it in GitHub Desktop.
Download last file from remote server with ssh
FILE_TO_DOWNLOAD=`ssh [email protected] 'ls -Art /tmp/dir |tail -n 1'`
scp [email protected]:/tmp/dir/${FILE_TO_DOWNLOAD} .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment