如何修改文件权限

如何修改文件权限

本文介绍了如何修改文件权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了脚本(steamBlob.command),它删除文件
/ Users / myuser / Library / Application \ Support / Steam / ClientRegistry.blob
...和另一个。代码

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

文件steamBlob.command无法执行,因为您没有适当的访问权限。

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

我试过进入finder并将所有权限更改为读写,但问题仍然存在。我应该运行这个作为sudo?

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

感谢,

-me

推荐答案

问题是你没有对steamBlob.command文件的执行访问。从终端,你可以chmod + x'filename'(使用适当的'filename'值)。另外,我将使用.sh作为扩展名,并使第一行#!/ bin / tcsh(或脚本编写的任何shell)。

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).

这篇关于如何修改文件权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-13 09:46