Cygwin Online Tutorials

Cygwin (/ˈsɪɡwɪn/ SIG-win) is a Unix-like environment and command-line interface for Microsoft Windows.

Cygwin
Original author(s)Steve Chamberlain, Cygnus Solutions
Developer(s)Cygnus Solutions, Red Hat, Cygwin project volunteers
Initial releaseOctober 18, 1995; 28 years ago (1995-10-18)
Stable release
3.5.0-1 Edit this on Wikidata / 1 February 2024; 2 months ago (1 February 2024)
Repository
  • cygwin.com/git/newlib-cygwin.git Edit this at Wikidata
Written inC/C++
Operating systemMicrosoft Windows
TypePOSIX standard utilities, POSIX standard library, C standard library, compatibility layer
LicenseGPLv3, LGPLv3
Websitecygwin.com Edit this on Wikidata

The terminal emulator Mintty is the default command-line interface provided to interact with the environment. The Cygwin installation's directory layout mimics the root file system of Unix-like systems, with directories such as /bin, /home, /etc, /usr, and /var.

In addition to providing many Unix utilities and a Unix look and feel, Cygwin allows source code designed for Unix-like operating systems to be compiled and run on Windows with minimal modification.

Cygwin provides native integration of Windows-based applications. 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:

Cygwin is free and open-source software, released under the GNU Lesser General Public License version 3. It was originally developed by Cygnus Solutions, which was later acquired by Red Hat (now part of IBM), to port the Linux toolchain to Win32, including the GNU Compiler Suite. Rather than rewrite the tools to use the Win32 runtime environment, Cygwin implemented a POSIX-compatible environment in the form of a dynamic-link library (DLL).

The brand motto is "Get that Linux feeling – on Windows".

History edit

Cygwin began in 1995 as a project of Steve Chamberlain, a Cygnus engineer who observed that Windows NT and 95 used COFF as their object file format, and that GNU already included support for x86 and COFF, and the C library newlib. He thought it would be possible to retarget GCC and produce a cross compiler generating executables that could run on Windows. This proved practical and a prototype was developed.

Next Chamberlain bootstrapped the compiler on a Windows system, sufficiently emulating Unix to let the GNU configure shell script run. A Bourne shell-compatible command interpreter, such as bash, was needed and in turn a fork system call emulation and standard input/output. Windows includes similar functionality, so the Cygwin library just needed to provide a POSIX-compatible application programming interface (API) and properly translate calls and manage private versions of data, such as file descriptors.

Initially, Cygwin was called gnuwin32 (not to be confused with the current GnuWin32 project). The name was changed to Cygwin32 to emphasize Cygnus' role in creating it. When Microsoft registered the trademark Win32, the 32 was dropped to simply become Cygwin.

By 1996, other engineers had joined in, focusing on making Cygwin useful at hosting Cygnus' embedded tools on Windows systems (the previous strategy had been to use DJGPP). It was especially attractive because it was possible to do a three-way cross-compile, for instance to use a hefty Sun Microsystems workstation to build, say, a Windows-x-MIPS cross-compiler, which was faster than using the PC at the time. In 1999, Cygnus offered Cygwin 1.0 as a commercial product. Subsequent versions have not been released, instead relying on continued open source releases.

Geoffrey Noer was the project lead from 1996 to 1999. Christopher Faylor was lead from 1999 to 2004 when he left Red Hat and became co-lead with Corinna Vinschen until Faylor withdrew from active participation in the project mid-2014. Corinna Vinschen has been the project lead from mid-2014 to date (as of March 30, 2023).

From June 23, 2016 the Cygwin library version 2.5.2 was licensed under the GNU Lesser General Public License (LGPL) version 3.[17]

Description edit

The Cygwin environment is provided in two versions; the full 64-bit version and a stripped down 32-bit version whose final version was released in 2022.[18] Cygwin consists of a library that implements the POSIX system call API in terms of Windows system calls to enable running of a large number of application programs equivalent to those on Unix systems, and a GNU development toolchain (including GCC and GDB) to allow software development. Programmers have ported many Unix, GNU, BSD and Linux programs and packages to Cygwin, including the X Window System, K Desktop Environment 3, GNOME,[19] Apache, and TeX. Cygwin permits installing inetd, syslogd, sshd, Apache, and other daemons as standard Windows services, allowing Microsoft Windows systems to emulate Unix and Linux servers.

Cygwin programs are installed by running Cygwin's "setup"[20] program, which downloads the necessary program and feature package files from repositories on the Internet. Setup can install, update, and remove programs and their source code packages. A complete installation will take in excess of 90 GB[21] of hard disk space, but usable configurations may require as little as 1 or 2 GB.

Efforts to reconcile concepts that differ between Unix and Windows systems include:

  • A Cygwin-specific version of the Unix mount command allows mounting Windows paths as "filesystems" in the Unix file space. Initial mount-points can be configured in /etc/fstab, which has a format very similar to Unix systems, except that Windows paths appear in place of devices. Filesystems can be mounted in binary mode (by default), or in text mode, which enables automatic conversion between LF and CRLF endings (which only affects programs that open files without explicitly specifying text or binary mode).
  • Cygwin 1.7 introduced comprehensive support for POSIX locales and many character encodings, whereby the UTF-8 Unicode encoding became the default. Windows file-names and other identifiers, which are encoded as UTF-16, are automatically converted to and from the selected character-encoding.
  • Windows drive letters map to a special directory, so for example C: appears as /cygdrive/c. The /cygdrive prefix can be changed. Windows network paths of the form \\HOST\SHARE\FILE are mapped to //HOST/SHARE/FILE. Windows paths can also be used directly from Cygwin programs, but many programs do not support them correctly, hence this is discouraged.
  • Full-featured /dev and /proc file-systems are provided. /proc/registry provides direct filesystem access to the registry.
  • Cygwin supports POSIX symbolic links, representing them as plain-text files with the system attribute set. Cygwin 1.5 represented them as Windows Explorer shortcuts, but this was changed for reasons of performance and POSIX correctness. Cygwin also recognises NTFS junction points and symbolic links and treats them as POSIX symbolic links, but it does not create them as their semantics are not fully POSIX-compliant.
  • The POSIX API for handling access control lists (ACLs) is supported and maps to the Windows NT ACL system.[22]
  • Special formats of /etc/passwd and /etc/group are provided that include pointers to the Windows equivalent SIDs (in the Gecos field), allowing for mapping between Unix and Windows users and groups.
  • The fork system call for duplicating a process is fully implemented, but it does not map well to the Windows API. For example, the copy-on-write optimization strategy could not be used.[23][24][25] As a result, Cygwin's fork is rather slow compared with Linux and others. (That overhead can often be avoided by replacing uses of the fork/exec technique with calls to the spawn functions declared in the Windows-specific process.h header).
  • The Cygwin DLL contains a console driver that emulates a Unix-style terminal within the Windows console. Cygwin's default user interface is the bash shell running in the Cygwin console.
  • The DLL also implements pseudo terminal (pty) devices. Cygwin ships with a number of terminal emulators that are based on them, including mintty, rxvt/urxvt, and xterm. These are more compliant with Unix terminal standards and user interface conventions than the Cygwin console, but are less suited for running Windows console programs.
  • Various utilities are provided for converting between Windows and Unix paths and file formats, for handling line ending (CRLF/LF) issues, for displaying the DLLs that an executable is linked with, etc.
  • Apart from always being linked against the Cygwin DLL, Cygwin executables are normal Windows executables. This means that Cygwin programs have full access to the Windows API and other Windows libraries, which allows gradual porting of programs from one platform to the other. However, programmers need to be careful about mixing conflicting POSIX and Windows functions.

The version of gcc that comes with Cygwin has various extensions for creating Windows DLLs, specifying whether a program is a windowing or console-mode program, adding resources, etc. Support for compiling programs that do not require the POSIX compatibility layer provided by the Cygwin DLL used to be included in the default gcc, but as of 2014 is provided by cross-compilers contributed by the MinGW-w64 project.

Cygwin is used for porting many popular pieces of software to the Windows platform.[26] It is used to compile Sun Java, LibreOffice, Apache OpenOffice and web server software like Lighttpd and Hiawatha.[27]

The Cygwin API library is licensed under the GNU Lesser General Public License version 3 (or later) with an exception to allow linking to any free and open-source software whose license conforms to the Open Source Definition[28] (less strict than the Free Software Definition).

Software features edit

Cygwin's base package selection is fairly small (about 100 MB[29]), containing little more than the bash (interactive user) and dash (installation) shells and the core file and text manipulation utilities expected of a Unix command line. Additional packages are available as optional installs from within the Cygwin Setup program and package manager ("setup-x86_64.exe" – 64bit). These include (from over 12000 others[30]):

  • Shells (i.e. command line interpreters): bash, dash, fish, pdksh, tcsh, zsh, mksh
  • File and system utilities: coreutils, findutils, util-linux
  • Text utilities: grep, sed, diff, patch, awk
  • Terminals: mintty, rxvt, screen
  • Editors: ed, emacs, joe, mined, nano, vim
  • Remote login: ssh, rsh, telnet
  • Remote file transfer/synchronization: ftp, scp, rsync, unison, rtorrent
  • Compression/archiving: tar, gzip, bzip2, lzma, zip
  • Text processing: TeX, groff, Ghostscript
  • Programming languages: C, C++, Objective-C, Fortran, Gambas, Perl, Python, Ruby, Tcl, Ada, CLISP, Scheme, OCaml, Prolog
  • Development tools: make, autotools, flex, bison, doxygen
  • Version control systems: cvs, subversion, git, mercurial
  • Servers: Apache, BIND, PostgreSQL, Pure-FTPd, OpenSSH, telnetd, exim, UW IMAP
  • Clients: Mutt (email), Lynx (web), Irssi (IRC), tin (newsgroups)

The Cygwin/X project contributes an implementation of the X Window System that allows graphical Unix programs to display their user interfaces on the Windows desktop. This can be used with both local and remote programs. Cygwin/X supports over 500 packages including major X window managers, desktop environments, and applications, for example:

  • Terminals: rxvt-unicode, xterm
  • Editors: emacs-X11, gvim
  • Text processors/viewers: LyX, xpdf, xdvi
  • Web browsers: epiphany, konqueror, links, lynx, midori, qupzilla, w3m

In addition to the low-level Xlib/XCB libraries for developing X applications, Cygwin ships with various higher-level and cross-platform GUI frameworks, including GTK+ and Qt.

The Cygwin Ports project provided[when?] many additional packages that were not available in the Cygwin distribution itself. Examples included GNOME and K Desktop Environment 3 as well as the MySQL database and the PHP scripting language. Most ports have been adopted by volunteer maintainers as Cygwin packages, and Cygwin Ports are no longer maintained.

See also edit

  • Windows Subsystem for Linux – Compatibility layer for running Linux binary executables natively on Windows

Cygwin Tutorials: 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.

Latest online Cygwin Tutorials with example so this page for both freshers and experienced candidate who want to get job in Cygwin company

Latest online Cygwin Tutorials for both freshers and experienced

advertisements

View Tutorials on Cygwin View all questions

Ask your interview questions on Cygwin

Write Your comment or Questions if you want the answers on Cygwin from Cygwin Experts
Name* :
Email Id* :
Mob no* :
Question
Or
Comment* :
 





Disclimer: PCDS.CO.IN not responsible for any content, information, data or any feature of website. If you are using this website then its your own responsibility to understand the content of the website

--------- Tutorials ---