Solved

Using Unix command on dos prompt

Posted on 2004-09-15
8
739 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
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
AS400  SNDDST Truncating 5 93
Free software for creating ISO files of USB drives 9 99
Time Machine reports 'Disc Full' 3 72
Changing names of Physical Servers 1 47
Introduction How to create multiboot configuration with XP\Vista and Windows 7 on it? And most important question - how to do this correctly so not to have any kind of nightmares we get when system gets screwed? First of all one should realize t…
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 …
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.

808 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