1
0 Comments

What is the reason for the variation in output of the “wsl” command when a Linux command is enclosed within quotation marks?

C:\Users\elitebook>wsl "ls /"
/bin/bash: ls /: No such file or directory

C:\Users\elitebook>wsl ls /
bin  boot  dev  etc  home  init  lib  lib64  media  mnt  opt  proc  root  run  sbin  srv  sys  tmp  usr  var

I am uncertain about the outcome, and also, how can I execute more complex commands like if I want to run “echo $PATH > /home/out.file“:

C:\Users\arman_ogda7cp>wsl echo $PATH > /home/out.file
The system cannot find the path specified.
Askify Moderator Edited question April 25, 2023