LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   access directory outside of home directory? (https://www.linuxquestions.org/questions/linux-newbie-8/access-directory-outside-of-home-directory-801892/)

runinguy 04-13-2010 11:35 PM

access directory outside of home directory?
 
I'm using Mac OS X's Terminal.app shell to compile and run Fortran programs. One such program resides outside of my home directory (it is in the Applications folder, which resides on my hard drive but seems to be outside of my home folder).

How can I navigate into this directory using Terminal.app to run the programs that reside there?

bakdong 04-13-2010 11:52 PM

cd /applications ?

grail 04-14-2010 12:56 AM

If you try:
Code:

echo $PATH
See if where the application lives is in this path, if so you should be able to just use the name of the application.

If not, than as bakdong suggests, you can change directory (cd) to path name (/path/to/application)

evo2 04-14-2010 01:21 AM

Sorry, not sure I understand your post. Are are you asking an OSX question on a linux forum? Or is this a general *nix type question about how to use the command line? Or perhaps something else?

Evo2.

runinguy 04-15-2010 02:48 AM

When I type:

Code:

cd/applications
it does indeed change to the applications directory and displays all of it's contents, but I would like to try and understand why. When I change to this directory, this:

Code:

username-MacBook-Pro:~ username$
changes to:

Code:

username-MacBook-Pro:applications username$
In my very limited experience with the command line (just compiling and executing a few fortran code files) I have not seen this, the tilde has always preceded my username. What exactly is happening when I do this?

evo2 04-15-2010 02:54 AM

You appear to simply be showing what your prompt looks like. To find out the current directory (aka "present working directory") you should use the command "pwd".

"~" just means the home directory of the currently logged in user,"~username" means the home directory of the the user "username". Exactly what the prompt shows is a different (but sometimes related) topic.

Some prompts are setup to show what the current directory is. Yours appears to be doing this. It seems to be setup to show:

Code:

<hostname>:<current directory> <username>$
Evo2.

bakdong 04-15-2010 02:57 AM

You're seeing the current directory and the user you are logged into. What is the output of pwd, and whoami?

pwd
username-MacBook-Pro:applications

whoami
username

and the $ sign signifies the account doesn't have root privileges.

btw, cd has to have a space after it. cd/applications will always give an error.

runinguy 04-16-2010 01:13 AM

Thanks for your responses. I see now that my question really should have been: what does the prompt show me.

Like I said, very limited experience.


All times are GMT -5. The time now is 01:49 AM.