Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Linux executeable file

Status
Not open for further replies.

ashley75

Technical User
Oct 4, 2002
94
US
what is the executeable file we can use in Linux ??? For example, we have .BAT or .EXE file in Windows.
 
In any *nix (Linux, Solaris, HP-UX, AIX, etc...), the file names do not determine if a program is executable.

Any file can be made executable by doing a

chmod +x <filename>

Any file - yes. If you create a text document, you can make it executable. It will give errors and abort, but the system will attempt to run it.

Bill.
 
If you want to find the executables, try ls -l (you may be able to use ll). The output looks like this.





total 156


drwxr-xr-x 5 root root 4096 Oct 7 18:52 buttons


drwxr-xr-x 2 root root 4096 Oct 7 18:52 help


drwxr-xr-x 2 root root 4096 Oct 7 18:52 images


-rw-r--r-- 1 root root 592 May 15 2001 opera_16x16.png


-rw-r--r-- 1 root root 825 May 15 2001 opera_22x22.png


-rw-r--r-- 1 root root 1139 May 15 2001 opera_32x32.png


-rw-r--r-- 1 root root 1648 May 15 2001 opera_48x48.png


-rw-r--r-- 1 root root 108263 May 15 2001 opera.adr


-rw-r--r-- 1 root root 101 May 15 2001 opera.desktop


-rw-r--r-- 1 root root 152 May 15 2001 opera.wmconfig


-rw-r--r-- 1 root root 1322 May 15 2001 opera.xpm


drwxr-xr-x 2 root root 4096 Oct 7 18:52 styles




The ones marked drwxr-xr-x are directories (thus, the d).



[matt@linux opera]$ ll /usr/bin/op*


-rwxr-xr-x 1 root root 7132 Feb 23 2001 /usr/bin/open


-rwxr-xr-x 1 root root 771448 Mar 13 2001 /usr/bin/openjade


-rwxr-xr-x 1 root root 278988 Mar 14 2001 /usr/bin/openssl


-rwxr-xr-x 1 root root 10272 Mar 12 2001 /usr/bin/openvt


-rwxr-xr-x 1 root root 6397088 May 15 2001 /usr/bin/opera


[matt@linux opera]$




You'll usually find your executables in bin directories (/bin, /usr/bin, /usr/local/bin, etc). In this case, my Opera directory is in /usr/share but the executable is in /usr/bin - note the -rwxr-xr-x.



Your file listing may have a color scheme also. I use Red Hat 7.1 and by default, directories were listed in blue, executables in green.



Hope this helps.
 
Hi,

As explained above, whether a file is executable depends on the permissions (r = read, w =write, x = executable).

You can find files with the 'x' flag set on by doing :

cd wherever
find . -perm -111

That 'find' searches recursively from the start directory using the permissions flag and finds files / directories where the 'x' is set on for any of owner, group, other.

Linux (outside of X mime types) does not have an association between a file extension and an application either. For example files ending in .pl could be anything and not necessarily perl files. The system sneak reads the first line of an executable file to get the path to the associated application - this is called the shebang - something like this :

#!/bin/sh

Hope this helps

 
When I started to run the php file from the server(/var/ I'm getting the source code itself as output & unable to run the file. The server starter without any problem. I do not know how to proceed. Can u help me to solve this problem
 
PHP files are not executable code, they are interpreted, so unless you view them through a webserver that has been configured to handle them, you will only see the code, not the output of the code...

you need to access the code through something like
NOT
/var/
Hope that helps :)


---
John Hoke
If you found this post helpfull, please click below and let us know!
 
have you checked the /usr/local/apache-whatever-directory/conf/httpd.conf already? if not u need to add/edit some lines there in order for the server to parse/interpret php scripts...
1. uncomment/change the ff. lines:
<IfModule mod_dir.c>
DirectoryIndex index.html index.php index.php3 index.phtml
</IfModule>
2. #And for PHP4.x, use:
#
AddType application/x-httpd-php .html .php .php3 .phtml
AddType application/x-httpd-php-source .phps

hope it helps... (=

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top