I have installed WSL on Windows 10 Pro. And I need to execute bash commands from Windows Command Line like this:
bash -c ll
Expected: ll
command output in Command Line console
In practice: /bin/bash: ll: command not found
But its work for some commands like ls
or apt
.
Please, see :
What could be the problem?
1] Execute Shell Script file using WSLScroll to find WSL, check the box, and then install it. Once done, one has to reboot to finish installing the requested changes. Press Restart now. BASH will be available in the Command Prompt and PowerShell.
Run Linux tools from a Windows command line Run Linux binaries from the Windows Command Prompt (CMD) or PowerShell using wsl <command> (or wsl.exe <command> ). Binaries invoked in this way: Use the same working directory as the current CMD or PowerShell prompt. Run as the WSL default user.
To access the shell, simply type 'bash' in the Windows command prompt, and everything is good to go.
Once you've configured your system to run WSL (i.e., Bash on Ubuntu on Windows), access it by clicking the Bash on Ubuntu on Windows icon (Figure 1), which will launch you into a Bash console (Figure 2). The remainder of this article will show some of the interesting things you can do using the WSL.
ll
is a common alias (for ls -alF
in WSL; defined in the default .bashrc
). Depending on how you invoke bash
will determine whether the scripts which set up your system aliases are run. See the INVOCATION
section of the bash
manual.
You can use bash -i -c ll
to invoke bash
in an appropriate way for WSL.
Apparently ll
is an alias you defined in some of your configuration files. You should start bash as follows:
bash -ilc ll
Depending on where you defined the aliases, you can omit the -i
or -l
flag.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With