Inkscape 命令行,在 Mac 上的位置在哪里?

51
这是一个有点儿愚蠢的问题。我已经在我的Mac上安装了Inkscape(Marvericks操作系统),按照这个页面http://www.inkscape.org/en/download/mac-os/的说明进行。我知道Inkscape有一个命令行选项。我尝试在终端中输入inkscape,但没有这样的命令。我感到困惑...这是否意味着我需要安装Linux版本的Inkscape才能使用命令行?
3个回答

69

我已经在/Applications中安装了Inkscape并从终端运行它即可解决问题:

/Applications/Inkscape.app/Contents/MacOS/inkscape --help

Usage: inkscape-bin [OPTIONS...] [FILE...]

Available options:
  -V, --version                             Print the Inkscape version number

... etc.

为了方便使用,将其符号链接到/usr/local/bin,即:

将其符号链接到/usr/local/bin,即可轻松使用:

(Note: The original text seems to be a command or instruction, so I translated it accordingly)
ln -s /Applications/Inkscape.app/Contents/MacOS/inkscape \
      /usr/local/bin/inkscape

通常,在 MacOS 上调用 Inkscape 时需要使用绝对路径,并且所有作为参数给出的文件也应该是完整路径。另请参阅:

https://bugs.launchpad.net/inkscape/+bug/1449251


我尝试过这个,它打开了程序...这不是我想要的。 - olala
这个可行!但是其他东西有很多错误信息。另一个问题,我需要将这个路径放在PATH中才能直接调用inkscape吗? - olala
2
你可以将快捷方式添加到这类事物的正常位置。ln -s /Applications/Inkscape.app/Contents/Resources/bin/inkscape /usr/local/bin/inkscape这将为inkscape创建一个符号链接,指向标准路径中已经存在的文件夹。 - Scott
1
inkscape-bin 对我来说无法使用。然后我发现了http://wiki.inkscape.org/wiki/index.php/MacOS_X,上面说应该使用别名 alias inkscape="/Applications/Inkscape.app/Contents/Resources/bin/inkscape" - Adam
8
截至2020年,命令行应用程序在位置上的路径为/Applications/Inkscape.app/Contents/MacOS/inkscape - Stan James
显示剩余2条评论

38

截至2020年,MacOS上的可执行文件现已位于

/Applications/Inkscape.app/Contents/MacOS/inkscape

您可以使用符号链接进行链接:

ln -s /Applications/Inkscape.app/Contents/MacOS/inkscape \
  /usr/local/bin/inkscape

更多关于命令行使用的信息在这里


1
当我创建这个符号链接并尝试使用它时,我会收到以下错误:/usr/local/bin/inkscape: line 196: /usr/Contents/MacOS/inkscape-bin: No such file or directory /usr/local/bin/inkscape: line 196: exec: /usr/Contents/MacOS/inkscape-bin: cannot execute: No such file or directory有什么想法吗? - colmjude
@colmjude 在命令行中不要输入 "" 反斜杠。 - GeneCode

3
我认为随着时间的推移,一些路径和文件名已经发生了变化,今天你应该在 /usr/local/bin 中添加一个符号链接,指向inkscape的bin目录:

sudo ln -s /Applications/Inkscape.app/Contents/Resources/bin/inkscape /usr/local/bin/inkscape

完全归功于@Scott,他将这个正确的“答案”显示为评论。 这个解决方案允许inkscape的其他子命令正常工作,而创建别名则不行。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接