![在 WSL 命令行中使用别名](https://linux22.com/image/1163050/%E5%9C%A8%20WSL%20%E5%91%BD%E4%BB%A4%E8%A1%8C%E4%B8%AD%E4%BD%BF%E7%94%A8%E5%88%AB%E5%90%8D.png)
我正在尝试从我的 WSL bash.exe 启动 Atom 文本编辑器。我发现这手动的
并完全按照它的建议去做,但它不起作用。我还在 .bashrc 文件中发现了这条注释:
# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.
然后我创建了文件 .bash_aliases 并在其中添加了这个命令
alias atom=’/mnt/c/Windows/System32/cmd.exe /c “atom”’
在这两种情况下,别名的调用atom
都会产生以下输出:
grep: /etc/wsl.conf: No such file or directory
net.js:200
this._handle.open(options.fd);
^
Error: EINVAL: invalid argument, uv_pipe_open
at new Socket (net.js:200:18)
at createWritableStdioStream (internal/process/stdio.js:164:16)
at process.getStdout [as stdout] (internal/process/stdio.js:14:14)
at console.js:246:38
at NativeModule.compile (bootstrap_node.js:596:7)
at Function.NativeModule.require (bootstrap_node.js:541:18)
at setupGlobalConsole (bootstrap_node.js:310:41)
at startup (bootstrap_node.js:70:7)
at bootstrap_node.js:608:3