如何在 Xubuntu 上将文件标记为可执行文件?

Ben*_*Ben 3 xubuntu executable

我需要知道如何将文件标记为可执行文件,但复选框不存在。

小智 5

  1. Ctrl+ Alt+T打开终端。
  2. 通过cd在终端中输入命令来导航到文件的位置,例如。cd /documents/,然后输入以下内容:

    chmod +x yourfilename
    
    Run Code Online (Sandbox Code Playgroud)

要查看您的更改是否已保存ls -l,请在终端中输入以下内容。

将文件更改为可执行文件的其他方法是右键单击该文件,选择PropertiesPermisions并勾选Allow execution of the file as a program

希望这可以帮助。同样要执行该文件,您首先必须位于它所在的目录中。例如,如果您的文件位于Documents文件夹中,您必须cd(“更改目录”)进入该目录,然后执行以下操作:./yourfile.c

这是它的外观:

root@root:~/Documents$ ./file.c
Run Code Online (Sandbox Code Playgroud)