linux get name code example Example 1: how to get hostname on linux $ hostnamectl Example 2: linux version lsb_release -a