LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-13-2010, 11:35 PM   #1
runinguy
LQ Newbie
 
Registered: Mar 2010
Location: CA
Posts: 9

Rep: Reputation: 0
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?
 
Old 04-13-2010, 11:52 PM   #2
bakdong
Member
 
Registered: Apr 2009
Posts: 214

Rep: Reputation: 44
cd /applications ?
 
Old 04-14-2010, 12:56 AM   #3
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,007

Rep: Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191
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)
 
Old 04-14-2010, 01:21 AM   #4
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
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.
 
Old 04-15-2010, 02:48 AM   #5
runinguy
LQ Newbie
 
Registered: Mar 2010
Location: CA
Posts: 9

Original Poster
Rep: Reputation: 0
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?
 
Old 04-15-2010, 02:54 AM   #6
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
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.

Last edited by evo2; 04-15-2010 at 02:57 AM.
 
Old 04-15-2010, 02:57 AM   #7
bakdong
Member
 
Registered: Apr 2009
Posts: 214

Rep: Reputation: 44
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.

Last edited by bakdong; 04-15-2010 at 02:59 AM.
 
Old 04-16-2010, 01:13 AM   #8
runinguy
LQ Newbie
 
Registered: Mar 2010
Location: CA
Posts: 9

Original Poster
Rep: Reputation: 0
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.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
No write access to #home directory RichGags Linux - Newbie 9 01-24-2006 04:21 AM
programs have no access to home directory. SnowSurfAir Linux - Software 4 07-14-2005 12:05 AM
Others should not access my home directory. u4u Linux - General 3 01-16-2005 09:28 AM
vsftpd access to non-home directory rwhart Linux - Newbie 1 02-10-2004 01:42 AM
Access denied to 'Home' directory aviceda Linux - Newbie 2 11-07-2003 01:48 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:23 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration