I have a directory (let's call it master
) on a server.
Under the directory master
, there're many .txt
files; some .txt
files are under sub-directories in master
, say
/master/text1.txt
/master/sub-dir1/text2.txt
/master/sub-dir2/sub-dir3/text3.txt
There are also a big number of other types of files in the master
.
What I want to do is to scp
all the .txt
files under master
to my local, and retain the sub-directory structure, i.e. the result looks like
/local-dir/text1.txt
/local-dir/sub-dir1/text2.txt
/local-dir/sub-dir2/sub-dir3/text3.txt
How can I get this done?