why command are not recognized by the command prompt? - cmd

I have tried several times to type the command 'ls' at the command prompt of Windows 10 but it shows me that the command is not recognized as an internal or external command, an executable program or a batch file.

The "is" command is for Linux, not for Windows, and like Kraigolas said, the Windows OS command is "dir". Hope this helped.

The ls command is for linux and it's equivalent for windows command prompt is dir. But if you are more of a linux user then you can try using power-shell on windows where ls command works just like the way it works in linux. Power-shell is like a hybrid between windows command prompt and linux terminal.

Related

How to Determine the path of the "curl" command from the command prompt in Windows?

I just wanted to know if there was a way to find the path of the "curl" command on my computer. I open up the command prompt and I can execute the curl command no problem. But I have to wonder how does the command prompt know what the curl command is. I assume it is pointing to some executable somewhere. Is there a way to trace the location of the executable using the command prompt itself?
In Windows you can use the where command to locate programs
where curl.exe
On my machine it answers:
C:\Windows\System32\curl.exe

Certain commands on the Terminal not recognized

I have Windows 10 as an operating system, when I use the Node.js command prompt and type in the commands 'ls' or 'touch' I get a notification that it is not recognized as an internal or external command. However, when I use Windows Powershell those commands seem to be working. Should I install MINGW64? I attached a picture of what I am experiencing enter image description here
Perhaps I misunderstand the question - but touch and ls are Linux terminal commands
It appears you are typing them in a windows command prompt window which would yield:-
C:\Users\xxx>ls
'ls' is not recognized as an internal or external command,
operable program or batch file.
(in PowerShell at least, ls works)

How can I run a batch-file under windows git-bash console?

How can I run a batch-file uder windows git-bash console.
When I run it I get:
user#DESKTOP-DF012sh MINGW64 /c/project-folder
$ util.bat
bash: util.bat: command not found
It should work if you mention where the bat is.
./util.bat
By default, a $PATH does not include the current folder.
I just tested executing a .bat script that way, and it worked just fine.

adb: command not found- Window 10 shell

I am trying to run the adb command using adb shell. Running well on mac but not in the window.
Add the path to the folder containing adb.exe to the PATH environment variable. If you don't have adb.exe in your computer, download one.
(Off topic) Besides, you seems trying to run a Linux shell script on Windows, please use some software like Cygwin or MSYS2.

Open a file from Cygwin

Is there an equivalent to OSX open command in cygwin. open opens a file with the default application for that type.
I want to do something like
$ magic-command file.xls
#excel opens as if file.xls would have been double-clicked
$ magic-command file.txt
#notepad opens as if file.txt would have been double-clicked
You get the idea?
Basically something like a "cygwin-double-click" command.
You can also use the cygwin utility:
cygstart <your file>
To make things OSX-like add the following to your bashrc
alias open='cygstart'
Don't forget to check out the man page for cygstart.
You can use the start command from the CMD like this:
cmd /c start <your file>
explorer <your file>
works too. What is nice is
explorer .
opens a windows explorer window in the current directory. But then
cygstart .
does the same thing and does more, but I find 'explorer' slightly easier to remember.
I am using Cygwin in Win7. I can run file on windows through ccygwin command line.
cygstart <your file>
when you run this command your file will open in windows.
Under the Windows command-line interpreter (cmd.exe) there is support for the start command. I know of somebody who implemented start in cygwin. You can find the page about it here.
You could also simply call cmd.exe (usually located in /cygdrive/c/windows/system32/cmd.exe) with the following arguments cmd /c "start yourfile.file"
If, like me, you are using putty to ssh locally on your windows machine to Cygwin as cmd.exe is a terrible console, you may want to change your sshd service to allow it to access the local desktop (this will only work on certain windows flavors) under the sshd windows service Logon properties.
Yes, there is an equivalent to Windows, try with xdg-open <your file>

Resources