mirror of
https://github.com/github/awesome-copilot.git
synced 2026-04-30 12:15:56 +00:00
* new skill batch-files * batch-files: codespell, re-run start, suggestions, txt assets codespellrc: add FO for tasklist option validate-readme: re-run npm start apply suggestions from code review batch-files: change asset templates to text files * codespellrc: resolve spelling in comment
4.6 KiB
4.6 KiB
Cygwin Reference
Cygwin provides a large collection of GNU and Open Source tools that provide functionality similar to a Linux distribution on Windows, plus a POSIX API DLL (cygwin1.dll) for substantial Linux API compatibility.
Documentation
- Cygwin User's Guide — comprehensive official documentation
- Cygwin FAQ
- Cygwin Homepage
User's Guide — Table of Contents
Chapter 1: Cygwin Overview
- What is it? — POSIX compatibility layer and GNU toolset for Windows
- Quick Start Guide (Windows users) — Getting started for those familiar with Windows
- Quick Start Guide (UNIX users) — Getting started for those familiar with UNIX/Linux
- Are the Cygwin tools free software? — Licensing (GPL/LGPL)
- A brief history of the Cygwin project — Origins and evolution
- Highlights of Cygwin Functionality
- Permissions and Security
- File Access
- Text Mode vs. Binary Mode
- ANSI C Library
- Process Creation
- Signals
- Sockets and Select
- What's new and what changed — Release notes for all versions (1.7.x through 3.6)
Chapter 2: Setting Up Cygwin
- Internet Setup — Installing via
setup-x86_64.exe, mirror selection, package management - Environment Variables — Configuring
PATH,HOME,CYGWINand other environment variables - Changing Cygwin's Maximum Memory — Adjusting memory limits via the registry
- Internationalization — Locale and character set configuration
- Customizing bash —
.bashrc,.bash_profile, and prompt customization
Chapter 3: Using Cygwin
- Mapping path names — How Cygwin maps POSIX paths to Windows paths (
/cygdrive/c=C:\) - Text and Binary modes — Line ending handling (
\nvs\r\n), mount options - File permissions — POSIX permission model on NTFS, ACLs
- Special filenames — Device files,
/proc,/dev, socket files - POSIX accounts, permission, and security — User/group mapping,
passwd/groupfiles,ntsec - Cygserver — Background service for shared memory, message queues, semaphores
- Cygwin Utilities — Built-in command-line tools:
cygcheck— System information and package diagnosticscygpath— Convert between POSIX and Windows pathscygstart— Open files/URLs with associated Windows applicationsdumper— Create Windows minidumpsgetconf— Query POSIX system configurationgetfacl/setfacl— Get/set file access control listsldd— List shared library dependencieslocale— Display locale informationminidumper— Write a minidump of a running processmkgroup/mkpasswd— Generate group/passwd entries from Windows accountsmount/umount— Manage Cygwin mount tablepasswd— Change passwordspldd— List loaded DLLs for a processprofiler— Profile Cygwin programsps— List running processesregtool— Access the Windows registry from the shellsetmetamode— Control meta key behavior in the consolessp— Single-step profilerstrace— Trace system calls and signalstzset— Print POSIX-compatible timezone string
- Case-sensitive directories — Enabling per-directory case sensitivity on Windows 10+
- Using Cygwin effectively with Windows — Integration tips, running Windows programs from Cygwin
Chapter 4: Programming with Cygwin
- Using GCC with Cygwin — Compiling C/C++ programs with the Cygwin GCC toolchain
- Debugging Cygwin Programs — Using GDB and other debugging tools
- Building and Using DLLs — Creating shared libraries under Cygwin
- Defining Windows Resources — Resource files and
windres - Profiling Cygwin Programs — Performance profiling with
gprofandssp
Key Concepts for Batch Scripting
Invoking Cygwin from Batch Files
REM Run a Cygwin command from a batch file
C:\cygwin64\bin\bash.exe -l -c "ls -la /home"
REM Convert a Windows path to POSIX for Cygwin
C:\cygwin64\bin\cygpath.exe -u "C:\Users\John Doe\Documents"
REM Convert a POSIX path back to Windows
C:\cygwin64\bin\cygpath.exe -w "/home/jdoe/project"
Common Environment Variables
| Variable | Purpose |
|---|---|
CYGWIN |
Runtime options (e.g., nodosfilewarning, winsymlinks:nativestrict) |
HOME |
User home directory |
PATH |
Must include /usr/local/bin:/usr/bin for Cygwin tools |
SHELL |
Default shell (typically /bin/bash) |
TERM |
Terminal type for console applications |