how-to-use-wildcards-with-scp

#linux #tip

SCP ๋ช…๋ น์–ด๋ฅผ ์ด์šฉํ•ด์„œ, remote ์„œ๋ฒ„์—์„œ ์—ฌ๋Ÿฌ๊ฐœ์˜ ํŒŒ์ผ์„ ๋กœ์ปฌ ์„œ๋ฒ„๋กœ ๋‹ค์šด๋ฐ›๋Š” ๋ฐฉ๋ฒ•

scp 'SERVERNAME:/DIR/\*' .
  • quote, esacpe ๋ฌธ์ž๊ฐ€ * ์•ž์— ์žˆ์–ด์•ผํ•จ.

  • ๊ทธ๋ž˜์•ผ ํ•ด๋‹น * ๊ฐ€ ํŠน์ • ํŒจํ„ด์„ ์˜๋ฏธํ•˜๋Š” ์ง€ ์•Œ์ˆ˜ ์žˆ๋Š” ๋“ฏ.

  • ํ…Œ์ŠคํŠธ ํ•ด๋ณธ ๊ฒฐ๊ณผ, quote ๊ฐ€ ์—†์–ด๋„ \ ๋งŒ์œผ๋กœ๋„ ๋‚ด๊ฐ€ ์›ํ•˜๋Š” ํŒŒ์ผ๋“ค๋งŒ ๊ณจ๋ผ์„œ ๋‹ค์šด๋กœ๋“œ๊ฐ€ ๊ฐ€๋Šฅํ–ˆ์Œ.

R ์˜ต์…˜ ์‚ฌ์šฉ

scp -r ~/test_folder/ twpower@[IP์ฃผ์†Œ]:/home/twpower
  • ํด๋” ์ž์ฒด๋ฅผ ๋‚ด ๋กœ์ปฌ ์„œ๋ฒ„๋กœ ๋‹ค์šด๋กœ๋“œ.

์ฐธ๊ณ 

  • https://twpower.github.io/138-send-file-using-scp-command

  • https://unix.stackexchange.com/questions/27419/how-to-use-wildcards-when-copying-with-scp

Last updated