bash_profile 多行别名

标签 bash macos

我想运行一个名为“showfiles”的命令,该命令将运行命令“defaults write com.apple.finder AppleShowAllFiles TRUE”和“killall Finder”我该怎么做?

最佳答案

我不确定为什么@gahooa 建议的 && 选项不起作用,但还有另一种选择:创建一个 shell 函数:

showfiles() {
    defaults write com.apple.finder AppleShowAllFiles TRUE
    killall Finder
}

关于bash_profile 多行别名,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6685964/

相关文章:

linux - Bash - 使用 socat 的代理服务器

linux - 想要在 Linux Shell 脚本中按列显示输出

c - 程序在 Linux 和 Windows 上挂起,似乎在 Mac 上运行

linux - 带有 http get 参数的 wget 脚本

linux - Bash - 在 for 循环中 Grepping nc 输出

swift :NSBezier

swift - 从 ViewController 访问 AppDelegate 中的对象

objective-c - 同步核心数据 : iOS to OSX, 反之亦然

macos - 切换蓝牙的 AppleScript

linux - 使用正则表达式用 grep 删除点数