The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 06-29-2009
mbaste2 mbaste2 is offline
Registered User
  
 

Join Date: Jun 2009
Posts: 4
get the server's hostname

i read that if i issue :

cat /etc/sysconfig/network > textfile

i will be able to determine the hostname of the server that my linux workstation is connected to.

but there are several other lines outputted that i do not need. i just need the hostname part.

is there any other unix command i can use? i tried hostname, hostid but they give the name of the workstation, not the server's name.

thanks for any leads