New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
Apple Notebooks Apple's notebook computers including MacBook Pro, MacBook, MacBook Air, PowerBook, and iBook.

changing directory in Mac Terminal?


Post Reply New Thread Subscribe

 
Thread Tools
volterony

 
Member Since: Nov 05, 2010
Posts: 2
volterony is on a distinguished road

volterony is offline
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.

cheers
Volterony
QUOTE Thanks
bobtomay

 
bobtomay's Avatar
 
Member Since: Dec 22, 2006
Location: Texas, where else?
Posts: 25,054
bobtomay has a reputation beyond reputebobtomay has a reputation beyond reputebobtomay has a reputation beyond reputebobtomay has a reputation beyond reputebobtomay has a reputation beyond reputebobtomay has a reputation beyond reputebobtomay has a reputation beyond reputebobtomay has a reputation beyond reputebobtomay has a reputation beyond reputebobtomay has a reputation beyond reputebobtomay has a reputation beyond repute
Mac Specs: 15" MBP 2.33 C2D 256 4GB, MBA 13" i7 1.8, MB 2.0 2GB, Nano 4th, 3GS, iPad 1

bobtomay is offline
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.
QUOTE Thanks
Raz0rEdge

 
Raz0rEdge's Avatar
 
Member Since: Jul 17, 2009
Location: MA
Posts: 7,614
Raz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant future
Mac Specs: 27" i7 iMac, 24" iMac, 13" Macbook Air, iPhone 5 & 5S, iPod Nano 7th Gen, iPad 2 16GB WiFi, iPad 3

Raz0rEdge is offline
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>"..

Regards
QUOTE Thanks
vansmith

 
vansmith's Avatar
 
Member Since: Oct 19, 2008
Location: Toronto
Posts: 18,097
vansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond repute
Mac Specs: 2012 13" MBP (2.5 i5, 8GB)

vansmith is offline
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
QUOTE Thanks
volterony

 
Member Since: Nov 05, 2010
Posts: 2
volterony is on a distinguished road

volterony is offline
Hi

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?
Regards
Volterony
QUOTE Thanks
cradom

 
cradom's Avatar
 
Member Since: Feb 14, 2004
Location: Nederland, Texas
Posts: 3,262
cradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant future
Mac Specs: 21in iMac core2 Duo- 13in macbook - 10.9 on both

cradom is offline
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.
QUOTE Thanks

Post Reply New Thread Subscribe


« MBP losing 30 percent of charge overnight whilst turned off | Mini DVI to HDTV »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
Running Windows on Mac rickmahmoud Running Windows (or anything else) on your Mac 7 02-16-2008 11:31 PM
Mac Users Get More ISP Choices schweb Apple Rumors and Reports 1 03-06-2003 10:57 AM

All times are GMT -4. The time now is 03:10 AM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?