Following the first character, which indicates file or directory, there are 3 groups of 3 permissions each, from left to right: User (that's you), Group, and World (i.e. anyone logged into the computer.) Each has the three rwx permissions (or lack of permission) - so 9 permissions in total. The shortcut in entering permissions is to use numerical values representing the three permissions. For this r = 4, w =2, and x=1 so rwx = 7, r-- = 4 and so forth. (That's octal notation.) Now for your file permissions.
File read, write, and execute (run) permissions are
indicated by the letters rwx. Lack of permission is indicated by a "-"
in place of the letter giving permission.
#!/usr/bin/perl print "Hello, World!\n";Now try to execute the file. (Starting with "./" is necessary, - it means you are executing a program which is in your own directory.)
This result
./test.pl: Permission denied.is because your file hasn't been given execute permission.
The chmod command is used to assign and change permissions. To see the current permissions for your test.pl command:
will show the permissions as
-rw-r--r--So your permissions for this file are
rw-The "x" is missing. Use chmod to change that
Then check on the change
Note that the 7 in 744 changed rw- to rwx and the 44 left r--r-- unchanged.
Verify the new permissions via
And see what the rwx does by trying again to execute
If everything was done correctly, the result should be the standard greeting used by first time programs - Hello, World!