Using Unix command on dos prompt

Hi,
I installed cygwin but it gives a new window (shell) to use unix commands on. How can I use unix commands like "ls" etc on windows dos prompt? Is there some setting in cygwin that allows that? Any other tool for this?
sambha03Asked:
Who is Participating?
 
ITcrowConnect With a Mentor Commented:
I agree with Yuzh.

To add path:
set path=%path%;c:\path\to\cygwin\bin

Verify that your path got added:
path

If you see the path you added as the last item in the result, then you are good to go.
Try using any cygwin commands. ls, cp, etc.
0
 
Fatal_ExceptionSystems EngineerCommented:
Unix uses a different command interpreter than windows...  I believe that you must use the one that came with cygwin...  Unix commands have a completely different context than DOS commands, although the output is pretty much the same...  (Ls = Dir)
0
 
sambha03Author Commented:
I've seen someone use some basic commands like ls, cp etc in dos prompt. There must be some tool for it or it must be possible to configure cygwin to support some basic commands in windows prompt
0
Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

 
Fatal_ExceptionSystems EngineerCommented:
This may be of help here:

http://osr5doc.sco.com:1997/MergeAdminG/chap7.html

I am not a Unix guru by any means, but that article seems to make some sense..  :)
0
 
sambha03Author Commented:
The link is not working
0
 
yuzhCommented:
After cygwin is installed, you need to add the Cygwin\bin directory to your PATH, (eg
put it in autoexec.bat file, or just manually add it to PATH, then you can you the *nix
command.
0
 
yuzhCommented:
also have a look at "The Cygwin FAQ":
     http://www.cygwin.com/faq/
0
 
SunBowCommented:
Try cd command, change directory, same for both systems, but like MD they remain different for rules and syntax. Ans is to give it up.

Dos is os, which is different than unix, so it cannot and will not run unix command. It is more primitive, so aside from running of similar programs externally such as FTP or Ping, you cannot run alternative internal commands.  It does not work same in other way, for with unix flexibility already built in, you can more easily change how what command does what.   Slash vs backslash, dash vs slash, remains a typical syntactical problem for internal OS process.

So better imo keep them as separate, know which window does what, or without windows, know which OS was booted.

> you need to add the Cygwin\bin directory to your PATH

unfortunately, too easy to overload path and be misinterpreted.  For beginners, better i think to have a command window open directly to the subdirectory containing the programs to be run.  This is done easily enough by first creating a shortcut icon to open a command window (or cmd) and then assign the default subdirectory to begin running in, just as location for cygwin proggies.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.