LinuxQuestions.org
Help answer threads with 0 replies.
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-09-2004, 02:26 PM   #1
jimdaworm
Member
 
Registered: Aug 2003
Location: Spain
Distribution: Ubuntu
Posts: 897

Rep: Reputation: 30
problems linking programs directories in my path


Hey I thought this was kind of a newbie question.

I havenīt had problems linking devices before. What I want to do is link a program that I have in my home directory to a directory that is in the path (so I can run it from anywhere as a user).

I am not sure how I go about doing this so that when the link is run that it finds the sub directories which are located whith the real file (in my home directory)

Thanks
Adam
 
Old 04-09-2004, 02:34 PM   #2
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,988

Rep: Reputation: 388Reputation: 388Reputation: 388Reputation: 388
Try as root:

# ln -s <full path to app in your home directory> /usr/bin/<name of app>

For example:

# ln -s /home/<username>/myapp /usr/bin/myapp

That will put "myapp" in PATH by creating a link to myapp in /usr/bin which is always in PATH.
 
Old 04-09-2004, 02:43 PM   #3
jimdaworm
Member
 
Registered: Aug 2003
Location: Spain
Distribution: Ubuntu
Posts: 897

Original Poster
Rep: Reputation: 30
Thanks alot for your reply kilgoretrout I will give it a go and tell you how I get on!

Adam
 
Old 04-09-2004, 06:54 PM   #4
jimdaworm
Member
 
Registered: Aug 2003
Location: Spain
Distribution: Ubuntu
Posts: 897

Original Poster
Rep: Reputation: 30
Hey I tried:

bash-2.05b$ ln -s /home/adam/Xnview/xnview.sh /usr/bin/xnview.sh
bash-2.05b$ xnview
bash: xnview: command not found

What am I doing wrong?

Thanks anyway

Adam
 
Old 04-09-2004, 07:26 PM   #5
chii-chan
Member
 
Registered: Sep 2003
Location: chikyuu (E103N6)
Distribution: Redhat 8.0 (2.4.25-custom), Fedora Core 1 (2.4.30-custom)
Posts: 357

Rep: Reputation: 30
Try making softlink like this:

ln -s /home/adam/Xnview/xnview.sh /usr/bin/xnview

Remove that .sh part.
 
Old 04-11-2004, 05:09 AM   #6
jimdaworm
Member
 
Registered: Aug 2003
Location: Spain
Distribution: Ubuntu
Posts: 897

Original Poster
Rep: Reputation: 30
Hey chii-chan thanks for the tip! The link is working now but it doesnīt find the sub directorys that it needs to run the program (they are in /home/adam/Xnview/bin/ etc)

bash-2.05b$ xnview
/usr/local/bin/xnview: line 23: bin/xnview: No such file or directory
bash-2.05b$

How can I get it to see them??

Adam
 
Old 04-11-2004, 07:46 PM   #7
chii-chan
Member
 
Registered: Sep 2003
Location: chikyuu (E103N6)
Distribution: Redhat 8.0 (2.4.25-custom), Fedora Core 1 (2.4.30-custom)
Posts: 357

Rep: Reputation: 30
How about making another softlink in the /usr/local/bin? make a link to the bin/xnview, I think /home/adam/Xnview/bin/xnview
 
Old 04-11-2004, 08:13 PM   #8
megaspaz
Senior Member
 
Registered: Nov 2002
Location: Silly Con Valley
Distribution: Red Hat 7.3, Red Hat 9.0
Posts: 2,054

Rep: Reputation: 46
does this actually work? my guess is, if you want this to really work, you're going to need to check the permissions of your $HOME directory and all the subdirectories where the program is installed or the file you want to have accessible. you especially need to look at the permissions for "Others" since everyone accessing the program besides your user where the program is installed will be "Other". then again, what's the point of having a user account if you're going to let other users access that user's account? i'd suggest rethinking what you are trying to do.

Last edited by megaspaz; 04-11-2004 at 08:15 PM.
 
Old 04-11-2004, 10:28 PM   #9
emetib
Member
 
Registered: Feb 2003
Posts: 484

Rep: Reputation: 33
http://www.linuxquestions.org/questi...hreadid=165432

follow that through to the end. you might have to do one or the other. the first worked in mandrake for me, the second in debian.

cheers.
 
Old 04-14-2004, 03:27 PM   #10
jimdaworm
Member
 
Registered: Aug 2003
Location: Spain
Distribution: Ubuntu
Posts: 897

Original Poster
Rep: Reputation: 30
Hey thanks megaspaz the reason I was trying that was that I only have one user in my computer.

Thanks for you help to emetib I think I need to learn a bit more about how linking works.

I think there was a bug in the install program for xnview. Even as root it said that there was an error and that it couldnīt install as I wasnīt root. I just opened the install script and removed that part at the beginning of the program. It installed sweet... so at least it working for now.

Adam
 
  


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
linking directories david@aber Linux - Newbie 3 11-25-2004 07:45 AM
Linking Directories utahcon Linux - General 1 08-11-2004 06:54 PM
Symbolic linking directories leecming Linux - General 1 06-08-2004 11:11 AM
symbolic linking directories? Possible? ajspliffs Linux - General 3 01-12-2004 11:55 AM
Apache - problem linking to other directories Peanut Linux - Networking 5 11-30-2003 12:56 PM

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

All times are GMT -5. The time now is 12:32 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