In Windows cmd you can run wsl commands just by typing:
> wsl pwd
/mnt/c/Users/user/
But when I try to run functions that are stored in ~/.bashrc file, nothing is happening:
> wsl test
>
While in wsl function is working fine:
> test
/mnt/c/Users/user/
>
wsl bash -c test~/.bashrcis executed bybashonly on being Invoked as an interactive non-login shell. That is not the case on running from Windows Command Prompt Windows Subsystem for Linux and execute a command likebashwith the option-cto execute something bybashin the Linux environment.testis a Bourne Shell Builtin command. It is not advisable to name a functiontestin any shell script file including.bashrc.