文件名后的 ZSH 参数
我从 bash 切换到 zsh,我想知道是否有办法像 bash 一样将参数放在文件名后面 例子: cp dir1 dir2 -r
谢谢
I switched from bash to zsh and I was wondering if there was a way to put arguments after file name like in bash
Example:
cp dir1 dir2 -r
Thank you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这仅取决于命令,而不取决于 shell。 shell 按照给定的顺序传递参数,并且不会对以
-
开头的参数进行特殊处理。This depends only on the command, not on the shell. The shell passes the arguments in the order they're given, and makes no special treatment for arguments beginning with a
-
.zsh
在通配符和制表符补全方面有一些扩展/不同的功能(人们可能转向 zsh 的两个主要原因)。这两者都为您提供了添加命令行参数的有趣方法。你问的是这个吗?另请注意,大多数命令不受您选择的 shell 的影响:
ls
、awk
、grep
、vim
、显然,像alias
和function
这样的 shell 命令可能是不同的。zsh
has some expanded/different features in the area of globbing and tab completion (two of the primary reasons folks may switch to zsh). Both of these provide you interesting way to add command line parameters. Is that what you are asking about?Note also that most commands are not impacted by the shell you choose:
ls
,awk
,grep
,vim
, etc. Obviously things likealias
andfunction
that are shell commands are potentially different.