Solved

Using Unix command on dos prompt

Posted on 2004-09-15
8
737 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
 

Author Comment

by:sambha03
ID: 12071172
The link is not working
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

Hello I read in a discussion about a person who configured a very simple mirror RAID with two hard drives; the system and data were on the same partition. He asked how to repair the system as it was not booting up anymore. In his case running …
I use more than 1 computer in my office for various reasons. Multiple keyboards and mice take up more than just extra space, they make working a little more complicated. Using one mouse and keyboard for all of my computers makes life easier. This co…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

746 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now