如何更简洁地从命令行启动Chrome的标志? [英] How can I launch Chrome with flags from command line more concisely?

查看:371
本文介绍了如何更简洁地从命令行启动Chrome的标志?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个WebGL驱动的应用程序,我想从命令行启动chrome这样:

  open -a Google\ Chrome --args --disable-web-security 

我只是不想必须在每一个时间键入。有没有办法轻松地把它变成一个单字命令?

解决方案

只要在.bashrc或.bash_profile

$中建立别名b
$ b

  alias ogc ='open -a Google\ Chrome --args --disable-web-security'



然后重新载入您的shell。

  exec $ SHELL 

现在,每次输入 ogc (或任何你想调用它)在终端,它将运行完整的命令 open -a Google\ Chrome --args --disable-web-security


I am developing a WebGL driven application and I want to launch chrome like this from the command line:

open -a Google\ Chrome --args --disable-web-security

I just don't want to have to type that in every single time. Is there a way to easily turn that into a one word command? I am using a mac if it matters.

解决方案

Just make an alias in your .bashrc or .bash_profile

alias ogc='open -a Google\ Chrome --args --disable-web-security'

And then reload your shell.

exec $SHELL

Now, every time you type ogc (or whatever you want to call it) in your terminal, it will run the full command open -a Google\ Chrome --args --disable-web-security

这篇关于如何更简洁地从命令行启动Chrome的标志?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆