for users who may want to do the same or end up on this thread after a google search, these are the commands.
$ electrum restore xpub
OutPut
Recovering wallet...
Recovery successful
Wallet saved in '/home/ubuntu/.electrum/wallets/default_wallet'
I had this error though, wonder what is the issue
Exception in thread Thread-10 (most likely raised during interpreter shutdown):
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
File "/usr/lib/python2.7/threading.py", line 763, in run
File "/usr/local/lib/python2.7/dist-packages/electrum/blockchain.py", line 119, in init_headers_file
File "/usr/lib/python2.7/urllib.py", line 94, in urlretrieve
File "/usr/lib/python2.7/urllib.py", line 279, in retrieve
File "/usr/lib/python2.7/urllib.py", line 975, in close
File "/usr/lib/python2.7/socket.py", line 282, in close
File "/usr/lib/python2.7/ssl.py", line 397, in close