Odd Terminal Output...

Discussion in 'macOS' started by ltHank, Nov 8, 2008.

  1. ltHank macrumors newbie

    Joined:
    Nov 4, 2008
    #1
    Ever since I let my buddy charge his iPod on my computer, my Terminal displays the following for input:

    iPod~: [username]$
    (Where username is, of course, my username.)

    It didn't used to do this, and I have no idea how to interpret this. It doesn't seem to affect performance in any way, but I don't like having that there. I charge (and sync) my own iPod Shuffle all the time and have had no problems like this.

    Can anyone help me get back the default? I recall it is supposed to show the path, isn't it?
     
  2. scaredpoet macrumors 604

    scaredpoet

    Joined:
    Apr 6, 2007
    #2
    Under your Preferences Pane, in "Sharing," what's your computer name? If it's "iPod," there's your problem.
     
  3. ltHank thread starter macrumors newbie

    Joined:
    Nov 4, 2008
    #3
    The title for my computer under sharing is the same as it usually is (not 'iPod'!).
     
  4. belvdr macrumors 601

    Joined:
    Aug 15, 2005
    #4
    Check your hostname configuration in the network preferences.

    You can also check in Terminal, by issuing:
    Code:
    hostname
     
  5. ltHank thread starter macrumors newbie

    Joined:
    Nov 4, 2008
    #5
    That seems to be it:

    1. Checking the 'Network' preference pane (and going into 'Advanced...'), I found that the NetBIOS Name (under WINS) is 'IPOD,' in all capitals. Though this doesn't directly correspond to what is shown in Terminal ('iPod'), it does seem to lead me somewhere...

    2. Using the command 'hostname' yielded the following:

    iPod.[DNS Search Domain]
    (Where [DNS Search Domain] is the entry under 'Search Domain' in the 'DNS' part of the Network's Advanced menu)

    Should I just change the NetBIOS Name?
     
  6. belvdr macrumors 601

    Joined:
    Aug 15, 2005
    #6
    Yep. FYI, NetBIOS names are always capitals, but Unix can see them as case-sensitive. Just change it back to what you want. I believe you'll need to restart Terminal for it to recognize the change.
     
  7. ltHank thread starter macrumors newbie

    Joined:
    Nov 4, 2008
    #7
    Ach, it won't seem to keep any changes to the NetBIOS name. Interestingly, when I turn off my Airport, it switches back to my computer's name as listed in the Sharing pref. pane. Any idea on how to do to this exactly?

    I did manage to swap back to my computer name by forcing change using 'sudo hostname [name]', but it just reverts back to 'iPod' if I turn off my wireless and restart my wireless.
     
  8. belvdr macrumors 601

    Joined:
    Aug 15, 2005
    #8
    Check /etc/hosts on your system
    Code:
    cat /etc/hosts
    This sounds like it is caching it somewhere in DNS or /etc/hosts.
     
  9. ltHank thread starter macrumors newbie

    Joined:
    Nov 4, 2008
    #9
    Upon execution of 'cat /etc/hosts', I see the following.

    Code:
    ##
    # Host Database
    #
    # localhost is used to configure the loopback interface
    # when the system is booting.  Do not change this entry.
    ##
    127.0.0.1	localhost
    255.255.255.255	broadcasthost
    ::1             localhost 
    fe80::1%lo0	localhost
    
    I don't know exactly what to make of this, but I don't see 'iPod' in there...
     
  10. ltHank thread starter macrumors newbie

    Joined:
    Nov 4, 2008
    #10
    Now I am on a different wireless and my computer name has been returned to its rightful place in the terminal. When I get home again I'll check if the name is fully restored or if it is just somehow dependent on the network I am attached to. I'll post more then.
     
  11. kolax macrumors G3

    Joined:
    Mar 20, 2007
    #11
    What is your network name at home?

    I've noticed that when I'm connected to my University wireless, in Terminal it displays exactly the same as you, only instead of iPod it is part of the network name.
     
  12. darwinian macrumors 6502a

    darwinian

    Joined:
    Jan 4, 2008
    Location:
    In R4, more or less
    #12
    Here's one thing you can try. I am assuming you're using the OS X default shell of bash. One of your bashrc files in ~/ (.profile, .bash_profile, .bashrc) may or may not exist, in which case it is using the default prompt. If one of these files is set, you may see something in one of the files that looks like:

    PS1=\h\W: [\u]$

    That '\h' is displaying the host of the current network you are on. It resets only at each session of bash or invocation of 'source' (see below).

    If not, you can set this PS1 shell variable and play around with various prompt settings (and customize it). To do so, simply edit one of those above files (such as .bashrc) and then save it, and then run 'source ~/.bashrc' from the CLI in order to instantly see the reflected changes. You can find a list of customizable options at:

    http://www.linuxselfhelp.com/howtos/Bash-Prompt/Bash-Prompt-HOWTO-2.html

    under section 2.5.

    If you manage to screw something up, simply edit the file in another shell or in a GUI editor (such as TextMate, using show hidden files).
     
  13. ltHank thread starter macrumors newbie

    Joined:
    Nov 4, 2008
    #13
    TO: Kilamite
    Yeah, it seems to be related to my campus network. It set it self correctly when I left, but doesn't seemed to have restarted now that I am back. Interesting.

    TO: darwinian
    Thank you for the in-depth response... though at the moment it seems more or less over my head. I'll take a look at it, though, for future reference.
     
  14. kolax macrumors G3

    Joined:
    Mar 20, 2007
    #14
    Darwinian - thanks for that. I'll check out the link - I'm trying to learn the many Unix commands of Terminal.
     

Share This Page