1
1
I want to make my windows command prompt cmd+cygwin.
I should be able to run both windows cmd commands and cygwin commands from my windows cmd prompt.
If I add C:\cygwin64\bin
to my PATH variable i can run some cygwin commands like ls
and clear
and some more through cmd prompt, but cygwin style paths don't work in this case.
D:\>cd /cygdrive/d
The system cannot find the path specified.
Is there a clean way to do this?
UPDATE: Based on suggestions I tried it in Powershell.
PS C:\GIT_Repo> ls -lrt
Get-ChildItem : A parameter cannot be found that matches parameter name 'lrt'.
At line:1 char:4
+ ls -lrt
+ ~~~~
+ CategoryInfo : InvalidArgument: (:) [Get-ChildItem], ParameterBindingException
+ FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand
This command works in CMD prompt:
C:\GIT_Repo>ls -lrt
total 752
-rw-rw-r--+ 1 Ashish None 931 Jun 26 23:39 Mp3_Properties.py
-rwxrwxr-x+ 1 Ashish None 763247 Jun 26 23:44 'My_mp3_File.mp3'
Path don't work in Powershell too:
PS C:\GIT_Repo> cd /cygdrive/c
cd : Cannot find path 'C:\cygdrive\c' because it does not exist.
At line:1 char:1
+ cd /cygdrive/c
+ ~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (C:\cygdrive\c:String) [Set-Location], ItemNotFoundException
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.SetLocationCommand
Still no success.
1The windows command prompt does not understand / in paths. Period. I would suggest trying a Powershell prompt instead. It does understand / in paths. Be careful though because it already has some aliases to mimic linux commands with powershell cmdlets (ls -> Get-ChildItem). Overall though, it is a better choice than cmd. – EBGreen – 2018-07-13T14:44:08.540
So as I stated, Some commands will already have an alias in powershell. ls is even the example I literally used. As stated in the answer, Windows and Linux have different file structures. Really, if you want a bash experience just stay in cygwin. What is your ultimate goal? What are you trying to accomplish by not using the shell in cygwin? – EBGreen – 2018-07-13T16:25:37.193
I think we can't make windows cmd prompt cmd+cygwin, cygwin is a software which gives us some UNIX like functionality if used from its own cygwin terminal. If anyone is able to achieve it do post your answers. – Ashish Shirodkar – 2018-07-13T16:47:16.660
I am well aware of what cygwin is. I'm just wondering why you want to try to do bash style commands/activities in a windows specific shell? If you want a bash experience stay in the cygwin terminal. – EBGreen – 2018-07-13T16:50:01.320