Results 1 to 6 of 6

Thread: changing directory in Mac Terminal?

  1. #1

    Member Since
    Nov 05, 2010
    changing directory in Mac Terminal?
    Hi There,

    I am trying to change directory in Mac terminal.

    Currently, in my finder, the name for my computer is "Computer" but when I open up terminal, it says "localhost :~ myUsername$ ". So I think that somehow it is logged in under localhost?

    The question is therefore, how do I change from localhost to "Computer" (the name of my computer) and how can I actually change the name of my computer to something more memorable?

    I do have apache installed by default on my mac so I have somehow gone into this mode but I don't know how? Incorrect use of 'Sudo' ?

    Hopefully someone can help.


  2. #2

    bobtomay's Avatar
    Member Since
    Dec 22, 2006
    Texas, where else?
    Am not a Terminal guy.

    But, to change the name of your MacIntosh HD to something else - click on it on the Desktop so that it is highlighted - press Enter - Type whatever name you would like to call it - Press Enter again.

    You can also do the same thing in Finder if you don't have it showing on the Desktop.
    I cannot be held responsible for the things that come out of my mouth.
    In the Windows world, most everything folks don't understand is called a virus.

  3. #3

    Raz0rEdge's Avatar
    Member Since
    Jul 17, 2009
    Localhost is your computer's name..and it really doesn't matter much..

    When you open up Terminal for the first time, you'll be in your home directory "/Users/<username>". You can confirm this by type 'pwd' at the prompt.

    You can then do 'ls -l' to get a listing of all the files/directories there and this will match what you see in Finder.

    From there on, if you want [C]hange [D]irectory to a specific directory, you do "cd <directory>"..


  4. #4

    vansmith's Avatar
    Member Since
    Oct 19, 2008
    Quote Originally Posted by volterony View Post
    I do have apache installed by default on my mac so I have somehow gone into this mode but I don't know how? Incorrect use of 'Sudo' ?
    I'm sorry, this may be some miscommunication, but this doesn't make any sense. Are you having an issue with sudo or Apache?
    Important Links: Community Guidelines : Use the reputation system if you've been helped.
    M-F Blog :: Write for the blog
    Writing a Quality Post

  5. #5

    Member Since
    Nov 05, 2010

    Thanks for all your kind responses and advice as it is all very helpful indeed.

    With regard to the localhost/computer name issue Vansmith, my confusion is coming from the fact that my machine at work is called "MyComp" and when I open up terminal, I see MyComp: ~ myUsername$. However with my Mac Laptop, If I look in the finder, I see the computer name is "Computer" so I am assuming that if I opened up terminal it should show "Computer: ~ myUsername$". Beats me where Localhost came from because I did not specify that anywhere or change my computer name to localhost?

    As for bringing Sudo into the equation, I know it gives you 'super user' access and I have used this command in terminal to configure mysql, so what I was meaning was maybe I have l accidentally changed something. Remember that localhost is the name for Apache that runs as a service on your mac already. Using Sudo gives you temporary root privileges so you can start and stop Apache from the command line (as well and do it by turning web sharing on). Apache is running fine and I can view locally developed webpages using localhost. Essentially could I have used sudo incorrectly to create my 'localhost' issue (that is, an issue until I am convinced otherwise)?

    For further information, when I click on finder in the dock, under devices it has 3 things: Computer, iDisk, and Macintosh HD. In work, my finder says: MyComp, iDisk, and Macintosh HD. No mention of localhost anywhere!!

    Ultimately how do I change my computer name then? Would I need to log in as root or could I just use a sudo command to do it?

  6. #6

    cradom's Avatar
    Member Since
    Feb 14, 2004
    Groves, Texas
    You can change your prompt to whatever you want it to be:Bash Prompt HOWTO
    localhost is the system's reference name for your computer whatever it's name.
    To change the name of your computer, go to System Preference/ Sharing and put a new name in the box.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Changing file and directory permissions
    By danipoak in forum macOS - Operating System
    Replies: 0
    Last Post: 03-28-2015, 02:03 PM
  2. Using terminal to move files in a specific directory to a new location.
    By Alpha Spartan A in forum macOS - Operating System
    Replies: 2
    Last Post: 01-01-2013, 12:15 AM
  3. Open Terminal at Specific Directory
    By CastorTroy in forum macOS - Operating System
    Replies: 2
    Last Post: 11-12-2011, 09:24 PM
  4. Loss Home Directory because of Terminal
    By loadedguns in forum macOS - Operating System
    Replies: 14
    Last Post: 01-10-2010, 01:52 PM
  5. changing directory permission problem
    By almadrubuntu in forum macOS - Development and Darwin
    Replies: 1
    Last Post: 12-15-2005, 10:22 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts