LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-25-2008, 06:06 PM   #1
bobland
LQ Newbie
 
Registered: Nov 2008
Posts: 2

Rep: Reputation: 0
Running tar files


I recently had a problem after upgrading Ubuntu 7.10 32 bit to 8.10 64 bit. Sunbird would not work. I had to reinstall it but it would only install the 64 bit version which would not read my files.

I downloaded the 32 bit version and untared it to my download directory. It would not recognize the binary run files.

Found a web page that advised to move the sunbird directory to opt and make a link to usr. Worked like a charm!

Sunbird is the only directory in my /opt dir. Where does one normally put untared files for programs and what is the trick to get them to run?

I guess this question applies only to tars that untar in the pwd.

Thanks,
bobland
 
Old 11-25-2008, 06:49 PM   #2
uberNUT69
Member
 
Registered: Jan 2005
Location: Tasmania
Distribution: Xen Debian Lenny/Sid
Posts: 578

Rep: Reputation: 30
If you want to execute a program without typing it's full path, then it needs to be in your $PATH.
That would usually mean that you put it in /usr/local/bin or $HOME/bin, or a link from the extracted binary to one of those locations.
 
Old 11-25-2008, 08:05 PM   #3
rlhartmann
Member
 
Registered: Mar 2008
Posts: 73

Rep: Reputation: 16
Other options are to add the location to your PATH variable by
adding to it in the ~/.bash_profile as

PATH=$PATH:/path_to_program

or to simply add an alias in ~/.bashrc to the

alias pro='/opt/path/bin/program'

or to similar files for different shells.
 
Old 11-26-2008, 10:12 AM   #4
bobland
LQ Newbie
 
Registered: Nov 2008
Posts: 2

Original Poster
Rep: Reputation: 0
I can understand adding the program to the path variable but why wouldn't it run from its own directory?

bobland
 
Old 11-26-2008, 10:39 AM   #5
uberNUT69
Member
 
Registered: Jan 2005
Location: Tasmania
Distribution: Xen Debian Lenny/Sid
Posts: 578

Rep: Reputation: 30
if your current working directory ($PWD) is not in the $PATH then precede the command with ./

eg.
$ ls
mycommand.sh
$ mycommand.sh
bash: mycommand.sh: command not found
$ ./mycommand.sh
HOORAY!

 
Old 11-26-2008, 11:20 AM   #6
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 406Reputation: 406Reputation: 406Reputation: 406Reputation: 406
Quote:
Originally Posted by bobland View Post
I can understand adding the program to the path variable but why wouldn't it run from its own directory?

bobland
Because "./" (current dir) is not in $PATH.

You can add it, but it's considered a security risk. If you download some malware or someone place a binary file called "ls" in your home directory, and you have ./ in your $PATH it might be run instead of the system command ls, which might result in very bad things if it's indeed some kind of malware.

I advice you to follow the convention, and run the program as ./myprog, which is what everyone else does.
 
  


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
a tough question 4 u, problem in extracting tar & tar.gz files p_garg Linux - General 5 11-08-2010 11:02 AM
Decompress *.tar.tar files vathsan AIX 3 10-11-2008 12:47 PM
how to untar files with tar.tar extension johnkalikavunkal Linux - General 5 07-11-2008 05:36 AM
tar -zxvf foo.tar.gz creates all .gz files prophoto Linux - General 11 11-09-2006 06:27 PM
how to install .tar.bz and src.rpms and tar.gz files gadekishore Linux - Software 1 10-12-2005 08:09 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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