I know i can set read , write and execute permission to a file with chmod but can i take away the permission to delete, write and execute?
Removing is done by setting only the parts you want. For example, to remove write, and execute you would set the permission to
4 for that category of user. So to make only the owner have read, write, and execute and everyone else only read on a file you would use:
chmod 0744 ./target_file
Delete is done using write and execute on the directory that holds the file. In this example you could only allow the owner of the directory to delete files with:
chmod 0755 .