Could you recommend a wallet that I can use in Linux and control my keys?
There are 2 wallets which are considered the 'best ones'.
You can either choose a full node wallet (downloads and verifies the whole blockchain; does take a lot of time to sync with the network):
https://bitcoin.org/de/downloadOr you can choose a light-weight wallet (does not download/store the whole blockchain; it does get the information from an online service):
https://electrum.org/#homeThe more suitable for you would probably be electrum.
If you do hold a big amount of crypto, you might consider buying a hardware wallet. Those are way safer and more secured than a traditional desktop wallet.
Hardware wallets do contain the private keys in an 'airgapped' environment. A compromised computer does not lead to a loss of cryptos stored on a hardware wallet.
Also, I'm not sure what you mean by 'exchanges'.
Exchanges are institutions/companies which allow you to trade cryptos (e.g. coinbase/GDAX).
The reason I want to automate it is that I was thinking in using some machine learning technique to transfer my funds to the most suitable currency at the moment.
Then i would suggest that you have a trading stack on an exchange (e.g. binance) and write a small program which does buy/sell depending on your logic via binance's API.