Hello guys,
i am pretty new to linux and shell, currently, i am trying to use scp command to transfer files between my computer with a remote server.
every time i type like:
scp
user@remote_server.com:/dir/file_1 .
scp
user@remote_server.com:/dir/file_2 .
....
scp
user@remote_server.com:/dir/file_n .
then i write a script file called 'getr' and put into my /bin directory, the getr looks like
scp
user@remote_server.com:$1 .
now i only need to type 'getr /dir/file_1' and 'getr /dir/file_2' to fetch the files from the remote server.
if the files i needed have similar naming rules, i can use the regular expression like 'getr /dir/file_*' to
get the files by only one command, however, for many cases, files i need to fetch have quite different names, like two files with the name 'aaa.txt' and '123455_uyt',
so my question is
is there anyway a way to send the names of wanted files as arguments to some more advanced version of the currently 'getr', so that for several files with quite different names, i can also fetch them by one command?
thank you guys in advance.