Pages

Showing posts with label chmod. Show all posts
Showing posts with label chmod. Show all posts

User previleges (CHMOD) command

User privileges is one of the important feature. You can change the user privileges of files and directories as follows.

Here CHMOD stands for "change mode". Here is the full wiki page.

To change from normal file to executable file, use:

chmod u+x fileName

To change back to normal file, use:

chmod a-x  fileName

To change the permission 

chmod -R <permission> <dirname>

Once, I wanted to delete the directory recursively (!!!Warning: be careful here, once you delete, you can not recover it). To do this,

chmod -R 777 <dirname>      (then rmdir <dirname>)

Another useful onliner is the following.
Consider a situation where you mistakenly converted some files to executable files.
To covert an executable file to normal file, use:

chmod -x <filename>

To convert multiple files, use:

chmod -x  <foo*.txt>

Here is the list of posts that may be useful if you work in HPC, quantum chemistry, computational materials science, etc.



You may be interested in these posts

Error in image file conversion: convert-im6.q16: not authorized `test.eps' @ error/constitute.c/WriteImage/1037.

This error is because of the vulnerability. This allows remote execution of code using image formats. So, some Linux distributions by defaul...