How to modify file permissions

断了今生、忘了曾经 提交于 2020-01-05 07:22:10

问题


I made script (steamBlob.command), which deletes the file /Users/myuser/Library/Application\ Support/Steam/ClientRegistry.blob ... and another one. The code is

chmod +x steamBlob.command
rm -Rf /Users/pipsqueaker/Library/Application\ Support/Steam/ClientRegistry.blob 
rm -Rf /Users/pipsqueaker/Library/Application\ Support/Steam/AppUpdateStats.blob 
rm -Rf Users/pipsqueaker/Desktop/theRace.odt 

However, when I double click this to run it a windows pops up showing the message

The file “steamBlob.command” could not be executed because you do not have appropriate access privileges.

I've tried going into finder and changing all the permissions to "read and write", but the problem persists. Should I be running this as sudo? it'd be nice if someone could give me some detailed steps on how to clear this up

thanks,

-me


回答1:


The problem is that you don't have execute access on the steamBlob.command file. From terminal you can "chmod +x 'filename'" (use the appropriate value for 'filename'). Plus, I'd use ".sh" for the extension AND make the first line "#!/bin/tcsh" (or whatever shell for which the script is written).



来源:https://stackoverflow.com/questions/13676191/how-to-modify-file-permissions

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!