PDA

View Full Version : Terminal use question - how to access directories start from the hard disk


Byron Clarke
2005.08.28, 03:14 AM
I am learning the terminal and do not know how to do this:

access the directories of my hard disk from the terminal
eg: cd /MacintoshHD/Games/

can this be done and if so how can I do it?

Byron Clarke
2005.08.28, 03:20 AM
*does it 5 seconds later*

man I'm such a meathead :blink:

Andrew
2005.08.28, 09:29 PM
Also, if you have several different partitions and/or drives, look in /Volumes

Byron Clarke
2005.08.28, 11:45 PM
Another stupid question

how do you represent spaces when searching through directories?

open /games/Mine Swept/

opens at /games/Mine:

OneSadCookie
2005.08.28, 11:47 PM
open /games/Mine\ Swept/

blobbo
2005.08.28, 11:53 PM
If you hate doing that, and you're using Bash as your shell (10.3 and above, or manually configured below), just hit tab to autocomplete.

for instance, type "open /games/Min(TAB)" and it will fill in the rest. Very handy.

PowerMacX
2005.08.29, 12:21 AM
Of course, if the folder is already visible in the Finder, just drag it to the Terminal window, it will paste its path.

codemattic
2005.08.29, 12:44 AM
Also fyi you can drag any file or folder on top of the terminal window and Terminal.app will insert the full path.

Byron Clarke
2005.08.29, 12:49 AM
neato, thanks guys

Malarkey
2005.08.29, 01:18 AM
Another stupid question

how do you represent spaces when searching through directories?

open /games/Mine Swept/

opens at /games/Mine:

Hey, that's my game. :)

akb825
2005.08.29, 03:02 AM
Or you can put the path in quotes, and you won't have to escape the spaces.

Byron Clarke
2005.08.29, 04:29 AM
-malarkey-

lol my shareware $ is still in the mail :-) great job with the app. I have one complaint though (a small bug in the program maybe)

when you flag all of the mines, you still have to click all of the spaces before it acknowledges the win. adds a lot of time if you're going for the high score.

other than that its perfect

Malarkey
2005.08.29, 10:08 AM
-malarkey-

lol my shareware $ is still in the mail :-) great job with the app. I have one complaint though (a small bug in the program maybe)

when you flag all of the mines, you still have to click all of the spaces before it acknowledges the win. adds a lot of time if you're going for the high score.

other than that its perfect

Really? :blink: I'm pretty sure that's not the case since I have code specifically in there to check when you have all the mines flagged and to end the game right there. I'll check it out, though.

Edit: Nope, you're right. It's a bug. Good catch. :)

Edit: Oh wait, it's not a bug, it's a feature. :) The reason it's that way is because if the game ends when you correctly flag all the mines without revealing all the squares, it becomes easy to cheat the last mine by marking and unmarking mines until the game ends.