I have a bitcoin private key and I want to get the bitcoin address from it. What is the command in the command line for electrum to extract this address?
There is no cli command that can do this. You can do it via 3 methods:
In the Electrum GUI go to the view menu > show console and switch to the console tab. On the console tab type this:
Then once you have the address clear the console history or your private key will be saved to disk:
window.console.history = 
Another option is to simply import your private key into a new electrum wallet. File > new/restore, enter a unique filename and click next, choose to import addresses or private keys and then follow on-screen instructions for the rest.
OP has clarified that he wants to do this via bash so a third option is to write a custom python script:
#!/usr/bin/python3 from electrum import bitcoin import sys print(bitcoin.address_from_private_key(sys.argv))
Put the above in a file and
chmod +xit. Then run it with the private key as an argument. Obviously anyone else who runs
pson the same system at the same time will see your private key so this approach is not recommended.