Title: Is there an easy convertor between dpkg --print-architecture and uname -m for generic scp?
Tags: printing;cpu;scp;cp
Question: I want to copy files that relevant to my machines (x86_64 / aarch64) from remote machines.
I want to use: ```scp user@host:*$(uname)* .``` to copy both wheels and .deb files, e.g.:

name-x.y.z-cp36-cp36m-linux_x86_64.whl
name_x.y.z_amd64.deb

Now, using ```$(uname -m)``` will yield ```x86_64``` which matches the wheel, and using ```$(dpkg --print-architecture) will yield ```amd64` which matches the .deb
Locally, I use
```find . | grep -E &quot;$(uname -m)|$(dpkg --print-architecture)&quot; | xargs -I{} cp -u {} dst/
```
to find and copy - but I'm not sure how to move this into scp.
My current attempt is stuck with:
```scp user@host:dst/[*$(uname -m)*][*$(dpkg --print-architecture)*]
```
which finds nothing.

Comment: As I understand it, you want to grab *all* the files which **has** your print architecture in the filename ?


Here is another answer: After looking a bit - I found that this answer can help me.
Using ```rsync``` I was able to copy exactly what I wanted:
```py_version=$(python -V | cut -d' ' -f2 | tr -d &quot;.&quot;)

rsync -am --include=&quot;*$(dpkg --print-architecture)*&quot; --include=&quot;*${py_version:0:2}*$(uname -m)*&quot; --exclude=&quot;*&quot; user@host:dst .
```
Explanation:

```py_version=$(python -V | cut -d' ' -f2 | tr -d &quot;.&quot;)``` gets me the 2 first version digits (e.g. 3.6.9 -&gt; 36) which will help me pinpoint the wheel
```--include=&quot;*$(dpkg --print-architecture)*&quot;``` will pinpoint the .deb
```--include=&quot;*${py_version:0:2}*$(uname -m)*&quot;``` will pinpoint the wheel using architecture + python version
```--exclude=&quot;*&quot;``` will remove everything else



{'source': 'StackExchangeDataset', 'subset': 'askubuntu.com', 'metadata': {'AnswerCount': 1, 'CommentCount': 1, 'ContentLicense': 'CC BY-SA 4.0', 'CreationDate': '2022:00:03/07/22', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<printing><cpu><scp><cp>', 'Title': 'Is there an easy convertor between dpkg --print-architecture and uname -m for generic scp?', 'ViewCount': 97, 'id': 1396349, 'user_AboutMe': '<p>Loves C, and cookies</p>\n', 'user_AccountId': 4298052.0, 'user_DisplayName': 'CIsForCookies', 'user_Reputation': 1029.0, 'user_Views': 90.0, 'user_id': 768410.0}}