Executable files are highlighted as green in ubuntu (type ls /usr/bin
for example). Folders have read and execute (6) permissions by default. Setting it to 7 tells the terminal to display it as an executable. There are some great answers to colors for files and folders at https://askubuntu.com/questions/17299/what-do-the-different-colors-mean-in-the-terminal and https://unix.stackexchange.com/questions/94498/what-causes-this-green-background-in-ls-output
EDIT
As pointed out by @Carpetsmoker, 777 file permissions are dangerous because they allow anyone to change and run any code in the file with 777 permissions. Beyond running malicious code for the one file, they can write malicious code granting them access to the entire computer.
Notice that any set of permissions has three numbers. The first number refers to permissions for the owner of the file. The second number refers to permissions for the group the file is assigned to. The last number refers to permissions for everyone else. The number can be an integer 0-7. The reasoning for this is that each number in turn represents three binary numbers, i.e.
rwx = number
000 = 0
001 = 1
010 = 2
011 = 3
100 = 4
101 = 5
110 = 6
111 = 7
These binary numbers have meaning, as shown by the rwx. The r
column stands for read permissions (view contents of the file), the w
column stands for write permissions (change contents of the file), and the x
column stands for execute permissions (let the user have the *nix kernel run the code). 1 means "yes, it has this permission", 0 means "no, it does not have this permission".
So giving 777 file permissions is like saying
Owner: Can view, can change contents of, and can run code in this file.
rwx
111
Group: Can view, can change contents of, and can run code in this file.
rwx
111
Anyone else: Can view, can change contents of, and can run code in this file.
rwx
111
And as pointed out at Who can access a file with octal permissions "000" on Linux/UNIX? , the Root user will always have rwx permissions for all files and folders.