Questions tagged [cygwin]

Cygwin is a collection of GNU and other Unix-like FOSS tools which run on MS Windows and provide functionality similar to a GNU/Linux distribution while (mostly) conforming to POSIX specifications. Use this tag for questions about developing programs and/or scripts to run in this environment. Questions on the *use* of tools in a Cygwin environment are more appropriate for Super User (https://superuser.com).

Cygwin is a Unix-like environment and command-line interface for Microsoft Windows. Cygwin provides native integration of Windows-based applications, data, and other system resources with applications, software tools, and data of the Unix-like environment. Thus it is possible to launch Windows applications from the Cygwin environment, as well as to use Cygwin tools and applications within the Windows operating context.

Cygwin consists of two parts: a dynamic-link library () as an API compatibility layer providing a substantial part of the API functionality, and an extensive collection of software tools and applications that provide a Unix-like look and feel.

Cygwin is:

  • a collection of tools which provide a Linux look and feel environment for Windows.
  • a DLL (cygwin1.dll) which acts as a Linux API layer providing substantial Linux API functionality.

Cygwin is not:

  • a way to run native Linux apps on Windows. You must rebuild your application from source if you want it to run on Windows.
  • a way to magically make native Windows apps aware of UNIX® functionality like signals, `ptys, etc. Again, you need to build your apps from source if you want to take advantage of Cygwin functionality.

The Cygwin DLL currently works with all recent, commercially released x86 32 bit and 64 bit versions of Windows, with the exception of Windows CE and Windows NT4.

Official Website: http://www.cygwin.com/

Useful Links:

7878 questions
87
votes
7 answers

cygwin command to copy to windows clipboard

I see here: http://www.pgrs.net/2008/1/11/command-line-clipboard-access that there's a way in linux and osx to copy to the clipboard from the command line. So I ran my cygwin setup.exe, but couldn't find the xsel package. I'm guessing maybe this…
andersonbd1
  • 5,266
  • 14
  • 44
  • 62
86
votes
6 answers

Reading filenames into an array

I want to get a list of files and then read the results into an array where each array element corresponds to a file name. Is this possible?
dublintech
  • 16,815
  • 29
  • 84
  • 115
82
votes
12 answers

Safely change home directory

I'm trying to safely update the home directory as specified in /etc/passwd, but the standard Linux utils - usermod and vipw - for doing so aren't provided by Cygwin. Could anyone tell me how they changed this in Cygwin?
sblundy
  • 60,628
  • 22
  • 121
  • 123
82
votes
8 answers

Delete a file named "NUL" on Windows

I ran a program on Windows 7 that was compiled under Cygwin and passed "NUL" as an output file name. Instead of suppressing output it actually created a file named "NUL" in the current directory. (Apparently it expects "/dev/null", even on Windows.)…
EM0
  • 5,369
  • 7
  • 51
  • 85
81
votes
9 answers

Cygwin Make bash command not found

I installed cygwin with all the packages on windows 7 64 bit. For some reason the make command is giving me an error: bash make: command not found. I checked and in my bin folder, there is no make.exe. Can anyone help me on this? I really need make…
user593301
  • 903
  • 1
  • 8
  • 12
80
votes
13 answers

Git under windows: MSYS or Cygwin?

I plan to migrate my projects over to git, and I'm currently wondering which is the best and / or most stable option under windows. From what I gather I basically have 2.5 options: MSYSgit git under Cygwin (aka 2.5) MSYSgit from a Cygwin prompt…
joce
  • 9,624
  • 19
  • 56
  • 74
79
votes
11 answers

Where can I download an offline installer of Cygwin?

I need an offline installer with most of the utilities commonly needed. Somehow the default installer confuses me with all its package selection. I installed Cygwin but I can't find the diff utility after the installation.
Srikanth
  • 11,780
  • 23
  • 72
  • 92
79
votes
18 answers

How to cd into a directory with space in the name?

I'm attempting to get into the directory /cygdrive/c/Users/my dir/Documents: $ DOCS="/cygdrive/c/Users/my\ dir/Documents" $ echo $DOCS /cygdrive/c/Users/my\ dir/Documents $ cd $DOCS -bash: cd: /cygdrive/c/Users/my\: No such file or directory $ cd…
user2316667
  • 5,444
  • 13
  • 49
  • 71
75
votes
7 answers

How to crop(cut) text files based on starting and ending line-numbers in cygwin?

I have few log files around 100MBs each. Personally I find it cumbersome to deal with such big files. I know that log lines that are interesting to me are only between 200 to 400 lines or so. What would be a good way to extract relavant log lines…
bits
  • 8,110
  • 8
  • 46
  • 55
74
votes
16 answers

Cygwin/Git error cygheap base mismatch detected

I have installed two Windows servers with the latest versions of Cygwin and Git, and I am trying to clone the git repository from S1 to S2. I can successfully ssh from S2 to S1 using RSA keys, but when I do this : git clone…
John Zumbrum
  • 2,786
  • 8
  • 36
  • 60
73
votes
7 answers

Cannot launch Git GUI using Cygwin on Windows

I used to launch Git GUI within my Cygwin console without any problems, but since I updated Cygwin I've got the following error message: $ git gui Application initialization failed: no display name and no $DISPLAY environment variable Error in…
Stijn Vanpoucke
  • 1,425
  • 3
  • 17
  • 30
72
votes
3 answers

Cygwin - command not found

Running bash commands in cygwin produce the following error: $ ls ls: command not found This is a question that I self-answered on my tech blog where I keep the tech-tips which I need to give to myself from time to time, so I decided to move it…
Sudipta Chatterjee
  • 4,592
  • 1
  • 27
  • 30
70
votes
6 answers

Running a shell script through Cygwin on Windows

I have a bunch of shell scripts that used to run on a Linux machine. Now, we've switched over to Windows, and I need to run these scripts there. I have Cygwin installed, but is there a way to make the script run using Cygwin, but the call is made…
rainman_s
  • 1,088
  • 1
  • 8
  • 19
69
votes
3 answers

Updating file permissions with git-bash on Windows 7

How do I update file permissions with git-bash on Windows 7? I've tried the following without success: $ ls -al scripts/script.sh -rw-r--r-- 1 myUid Administ 70 Sep 8 11:24 scripts/script.sh $ git update-index --chmod=+x…
blueberryfields
  • 45,910
  • 28
  • 89
  • 168
69
votes
7 answers

Execute shell script in Gradle

I have a gradle build setup at the beginning of which I want to execute a shellscript in a subdirectory that prepares my environment. task build << { } task preBuild << { println 'do prebuild stuff:' } task myPrebuildTask(type: Exec) { …
Paul Latzelsperger
  • 711
  • 1
  • 6
  • 8