Results 1 to 3 of 3
How do I make a program execute just by typing the filename, instead of always having to type ./<filename> I think there is a way with chmod but don't know ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 08-04-2005 #1
How do I make a program execute just by typing the filename, instead of always having to type ./<filename> I think there is a way with chmod but don't know how.
Thanks!PTL x10 Hallelujah!
AMD Athlon XP 2600+ 512MB RAM Dual 80G WD HD 8MB Cache (1 WinXP Home, 1 CentOS 4.2) GeForce Ti4200 128MB SB Live! 5.1
Registered Linux user #391521
- 08-04-2005 #2
You can either,
1/ Put the executable in your path. (Find out your path by typing "echo $PATH)
2/ Put a link to the file in your path. If the executable is /home/username/exefile, then do this,Code:
cd /usr/bin ln -s /home/username/exefile
In both of these cases you will be able to execute the file by just typing exefile from any directory. My preference is always to do number 2.
Oh yeah, both of these options assume the file is actually executable by the user trying to execute it!!Registered Linux user #388328 || Registered LFS user #15880
AMD 64 X2 4600+ :: 2X1GB DDR2 800 :: GeForce 9400 GT 512MB :: ASUS M2N32 Deluxe :: 4X250GB SATAII
Need instant help? Try us on IRC -- #linuxforums on freenode
- 08-04-2005 #3
- Join Date
- Jan 2005
chmod has nothing to do with it.You need to put dot ie . in your PATH
variable so that every time you issue a command the shell will
also search in your working directory for the executable.Mind you
this is a security risk if you are root but as an ordinary user it's ok.