linux - scp files using wildcard. Destination contains result of wildcard -
how can user download many text files @ once remote host using scp terminal using wildcards? in addition, using result wildcard save file in same named directory (lets assume exists). remote directories contain other files different names. instance:
4 files in remote host:
[remote-host]:1dir/file.txt -> [local-host]:1dir/file.txt [remote-host]:2dir/file.txt -> [local-host]:2dir/file.txt [remote-host]:3dir/file.txt -> [local-host]:3dir/file.txt [remote-host]:4dir/file.txt -> [local-host]:4dir/file.txt
i have tried using following no avail. please assist
scp [remote-host]:'*dir/file.txt' '*dir/'
try following retrieve files:
scp user@host:~"/*dir/*.txt" .
or can try:
scp user@host:"~/*dir/*.txt" .
it depends on how user account mapped in environment..