There are two commands depending on the Python version:
Python 2:
python -c 'import tensor flow as tf; print(tf.__version__)'
Python 3:
python3 -c 'import tensor flow as tf; print(tf.__version__)'