LoginSignup
0
1

More than 3 years have passed since last update.

scpコマンドで最新のファイルを転送するワンライナー

Posted at

送信元にある最新のファイルを別のサーバーに転送したい時があり、以下のようにバッククォートで囲めばコマンドが実行され結果が得られます。

ワンライナーで必要な最新のファイルを取得して、転送することが出来ました。

scp `ls -1t /tmp/data/*.csv|head -n 1` user@hostname:/home/user/
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1