小智 5
通过cd
在终端中输入命令来导航到文件的位置,例如。cd /documents/
,然后输入以下内容:
chmod +x yourfilename
Run Code Online (Sandbox Code Playgroud)要查看您的更改是否已保存ls -l
,请在终端中输入以下内容。
将文件更改为可执行文件的其他方法是右键单击该文件,选择Properties → Permisions并勾选Allow execution of the file as a program。
希望这可以帮助。同样要执行该文件,您首先必须位于它所在的目录中。例如,如果您的文件位于Documents
文件夹中,您必须cd
(“更改目录”)进入该目录,然后执行以下操作:./yourfile.c
这是它的外观:
root@root:~/Documents$ ./file.c
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
28336 次 |
最近记录: |