LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 04-05-2003, 04:41 PM   #1
sulaiman_java
LQ Newbie
 
Registered: Apr 2003
Posts: 2

Rep: Reputation: 0
Problem with Liniux running things


Hi

I am new to linux but here is my problem, when ever I wont to run any file that is x it always give me this message

bash: hello: command not found

[root@localhost hello]# ls -l
total 116
drwxr-xr-x 3 sulaiman users 4096 Mar 31 16:27 docs
-rwxr-xr-x 1 root root 29881 Mar 31 16:27 hello
-rw-r--r-- 1 root root 1206 Mar 31 16:25 main.c
-rw-r--r-- 1 root root 25104 Mar 31 16:27 main.o
-rw-r--r-- 1 root root 17218 Mar 31 16:27 Makefile
-rw-r--r-- 1 sulaiman users 495 Mar 31 16:26 Makefile.am
-rw-r--r-- 1 root root 17458 Mar 31 16:27 Makefile.in
drwxr-xr-x 2 root root 4096 Mar 31 16:25 templates

also can't run any software like java or javac or. I am logging as root

I have RH 8.0

Please any idea HELP HELP

Sulaiman
 
Old 04-05-2003, 04:43 PM   #2
Crashed_Again
Senior Member
 
Registered: Dec 2002
Location: Atlantic City, NJ
Distribution: Ubuntu & Arch
Posts: 3,503

Rep: Reputation: 57
Re: Problem with Liniux running things

Quote:
Originally posted by sulaiman_java
Hi I am new to linux but here is my problem, when ever I wont to run any file that is x it always give me this message
Are you trying to run X applications? If so you must be in an X environment.
 
Old 04-05-2003, 04:47 PM   #3
doublefailure
Member
 
Registered: Mar 2002
Location: ma
Distribution: slackware
Posts: 747

Rep: Reputation: 30
try ./hello

you should add
export PATH=$PATH:.
in your profile
to make hello work without ./
 
Old 04-05-2003, 04:57 PM   #4
sulaiman_java
LQ Newbie
 
Registered: Apr 2003
Posts: 2

Original Poster
Rep: Reputation: 0
No it's not an X program it's just println Hello World,

Also I am in the same directory.

And the problem with every file, like I have download the new Sun Java JDK 1.4.1 the .sh file and I have chmod 777 to it but the result is the same

look

root@localhost Java]# j2sdk-1_4-beta-linux.sh
bash: j2sdk-1_4-beta-linux.sh: command not found
[root@localhost Java]# ls -l
total 88676
-rwxrwxr-x 1 root root 25450562 May 30 2001 j2sdk-1_3_1-linux-i386-rpm.bin
-rwxrwxrwx 1 root root 32276980 Apr 1 21:55 j2sdkee-1_4-beta-linux.sh
-rwxrwxr-x 1 root root 7232715 Apr 1 22:21 jakarta-tomcat-4.1.24.tar.gz
-rwxrwxr-x 1 root root 175 Apr 1 22:12 jakarta-tomcat-4.1.24.tar.gz.asc
-rw-rw-r-- 1 root root 25716356 May 6 2001 jdk-1.3.1.i386.rpm
[root@localhost Java]#

I am out of Ideas ... :-)
 
Old 04-05-2003, 04:59 PM   #5
Crashed_Again
Senior Member
 
Registered: Dec 2002
Location: Atlantic City, NJ
Distribution: Ubuntu & Arch
Posts: 3,503

Rep: Reputation: 57
In that case you should follow doublefailure's advice. That should do the trick.
 
Old 04-06-2003, 12:37 AM   #6
MasterC
Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 64
Notice the .

That means using this path run this application. Otherwise it will search your PATH variable and not locate the file (assuming it's not in your path) and return that error. The . overrides that and says "I am running this with absolute path":
./hello

The . means current directory. Comes in handy when copying files and things later; here's an example:
In /home/masterc/files there is a file called "LQ". I want to copy this to the directory I am in: /var/stuff/my/stuff/over/here/in/this/extremely/far/directory/i/am/in

Well to copy it you would type:
cp /home/masterc/files/LQ /var/stuff/my/over/here/in/this/extremely/far/directory/i/am/in
OR since you are already in that long directory:
cp /home/masterc/files/LQ .

Which will copy the file to the directory you are in. So run the app with . and that should fix it Just like was said above.

Cool
 
  


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help or advice in choosing liniux for a complete newbe pw1 Linux - Distributions 7 05-11-2005 06:45 PM
X display problems when running things from su natalinasmpf Slackware 4 01-20-2005 08:08 PM
System freezes - running out of things to test? ianv Linux - General 11 11-20-2003 02:37 PM
freeing unneeded resources [things running in the backround] centr0 Linux - General 3 02-26-2003 01:09 PM
Lilo and or Liniux not coming up after install kenny_dilger Linux - General 5 06-27-2002 09:01 PM


All times are GMT -5. The time now is 09:40 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration