To configure a Cisco switch for the 1st time and set a hostname, you need to do the following:
Switch>en enable gets you into privilege mode (Switch# prompt)
Switch#? shows available commands
Switch#conf t configure terminal enters global configuration mode
Switch#hostname switch1 sets the hostname
Switch#end back to privilege mode
Switch#copy running-config startup-config writes the config to switch
Switch#disable back to usermode