Solved

Using Unix command on dos prompt

Posted on 2004-09-15
8
740 Views
Last Modified: 2012-06-27
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?
0
Comment
Question by:sambha03
  • 2
  • 2
  • 2
  • +2
8 Comments
 
LVL 40

Expert Comment

by:Fatal_Exception
ID: 12071041
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
 

Author Comment

by:sambha03
ID: 12071054
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
 
LVL 40

Expert Comment

by:Fatal_Exception
ID: 12071170
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
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

by:sambha03
ID: 12071172
The link is not working
0
 
LVL 38

Expert Comment

by:yuzh
ID: 12072194
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
 
LVL 38

Expert Comment

by:yuzh
ID: 12072216
also have a look at "The Cygwin FAQ":
     http://www.cygwin.com/faq/
0
 
LVL 5

Accepted Solution

by:
ITcrow earned 250 total points
ID: 12073069
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
 
LVL 24

Expert Comment

by:SunBow
ID: 12078892
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

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
AIX  NFS  question 1 151
PERL - Find newest folder 12 149
vcenter/esxi crash?  Going haywire... 18 443
How to choose a USB to Serial Device that has preloaded drivers on the OS. 1 61
Occasionally Windows/Microsoft Updates will fail to update. We have found a code that will delete all temporary files and re-register all dll's related to Windows/Microsoft Updates! This works 99% of the time to get the updates working again! The…
As the title indicates, I have done this before. It chills me everytime I update the OS on my phone, (http://www.experts-exchange.com/articles/18084/Upgrading-to-Android-5-0-Lollipop.html) because one time I did this and I essentially had a bricked …
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question