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

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, 03:34 PM   #2
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,579

Rep: Reputation: 220Reputation: 220Reputation: 220
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, 03:43 PM   #3
jimdaworm
Member
 
Registered: Aug 2003
Location: Spain
Distribution: Ubuntu
Posts: 895

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, 07:54 PM   #4
jimdaworm
Member
 
Registered: Aug 2003
Location: Spain
Distribution: Ubuntu
Posts: 895

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, 08: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, 06:09 AM   #6
jimdaworm
Member
 
Registered: Aug 2003
Location: Spain
Distribution: Ubuntu
Posts: 895

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, 08: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, 09: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 09:15 PM.
 
Old 04-11-2004, 11:28 PM   #9
emetib
Member
 
Registered: Feb 2003
Posts: 482

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, 04:27 PM   #10
jimdaworm
Member
 
Registered: Aug 2003
Location: Spain
Distribution: Ubuntu
Posts: 895

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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

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

All times are GMT -5. The time now is 10:44 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration