The Cygwin tools are ports of the popular GNU development tools for Windows 9x/ME/NT/2000. They run thanks to the Cygwin library which provides the UNIX system calls and environment these programs expect. For example you find the popular Commandline Secure Shell Tools (SSH) to create a secure terminal emulation from Windows to Unix systems.
The following packages are available with the current release:
ash autoconf automake bash binutils bison byacc bzip2 clear cpio crypt cvs cygrunsrv cygwin dejagnu diff expect file fileutils findutils flex gawk gcc gdb gdbm gettext ghostscript gperf grep groff gzip inetutils irc jbigkit jpeg less libpng login lynx m4 make man mingw mt mutt ncftp ncurses newlib-man opengl openssh openssl patch pcre perl popt postgresql python readline regex rxvt sed sh-utils squid ssmtp tar tcltk tcsh termcap tetex-beta texinfo textutils tiff time unzip vim w32api wget which xpm xpm-nox zip zlib
Installation
Download the "setup.exe" Program from Cygwin (http://www.cygwin.com/setup.exe)
Run "setup.exe" from your download directory.
This will then download the list of available packages, and offer to install them for you. There are a number of options within setup to control installation details.
Choose "Download from Internet to Current Directory" from the setup Program
The selected packages are now downloaded to your local drive.
Choose "Install from Current Directory" from the setup Program
When installing, you will have to specify:
- Install root directory (e.g. D:\cygwin)
- Default Text File Type ("DOS" or "Unix")
- Install For ("All" or "Just Me")
Configuration Tips
Make sure you have set the HOME environment variable (e.g. C:\Home\Zahn)
Check and add your mounts with
mount
D:\Cygwin\bin on /usr/bin type system (binmode)
D:\Cygwin\lib on /usr/lib type system (binmode)
D:\Cygwin on / type system (binmode)
c: on /cygdrive/c type user (binmode,noumount)
d: on /cygdrive/d type user (binmode,noumount)
e: on /cygdrive/e type user (binmode,noumount)
If you need additional mount points create the directories and mount them e.g.
mount c:/uxhome /home/zahn
Check the automatically created mount points
The setup program will setup the needed mount points automatically. You can find them in the Windows registry under
HKEY_CURRENT_USER\Software\Cygnus\Cygwin\mounts v2
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus\Cygwin\mounts v2
How to use Device Files for tar ?
There is no need to create a POSIX /dev directory as it is simulated within Cygwin automatically. It supports the following devices: /dev/null, /dev/zero, /dev/tty, /dev/ttyX, /dev/ptmx, /dev/comX (the serial ports), /dev/windows (the windows message queue), /dev/random and /dev/urandom. These devices cannot be seen with the command ls /dev although commands such as ls /dev/tty work fine.
The Win32 device name for a partition is the drive letter with leading \\.\, so the floppy would be \\.\A:, the first partition typically \\.\C:. Complete drives (except floppies and CD-ROMS which are supported as partitions only) are named \\.\PHYSICALDRIVEx. The x is the drive number which you can check in the disk manager. Each drive line has prepended the text "Disk x".
To access tape drives the Win32 file name \\.\TAPEx is used. For example the first installed tape device is named \\.\tape0.
The naming convention is simple: The name of the POSIX device has to begin with /dev/ and the rest is as you like. The only exception are tape devices. To identify if the tape device is used as a rewind or a no-rewind device the name must not begin with n (rewind) or has to begin with n (no-rewind).
Some examples:
mount -b //./A: /dev/fd0 # mount floppy as raw block special
mount -b //./tape0 /dev/st0 # mount 1. tape as rewind device
mount -b //./tape0 /dev/nst0 # ...and as the no-rewind device
Note the usage of the -b option. It is best to include the -b option when mounting these devices to ensure that all file I/O is in "binary mode". Enter -s option to add mount point to system-wide registry location.
Now you can use tar as follows:
tar xvf /dev/st0 <dir>
Create and copy .bashrc to $HOME
The BASH shell can be configured with the configuration file $HOME/.bashrc (e.g)
# Aliases
alias more=less
alias up='cd ..'
alias ll='ls -la'
alias ls='ls -F'
alias ps='ps -Wl'
alias home='cd $HOME'
alias which='type -path'
alias unix2dos='recode lat1:ibmpc'
alias dos2unix='recode ibmpc:lat1'
alias h='history'
# Make Bash 8bit clean
set meta-flag on
set convert-meta off
set output-meta on
set completion-ignore-case on
# Set Prompt
PS1="`tput smso``whoami`@\h>`tput rmso` "
export PS1
PS2="> "
export PS2
Start BASH and enjoy the Unix Tools like SSH, SCP etc.
zahn@SMARAGD>ssh dbhost.akadia.com
We suggest to set the TERM variable for programs (e.g. vi) which use a correct terminal emulation to the following values:
Linux: TERM=linux; export TERM
Sun: TERM=ansi; export TERM
Example
The following screenshots shows a secure terminal emulation (SSH) from Windows to Unix using Cygwin's bash shell. The bash shell, like many other Unix utilities is ported to Windows.
http://www.akadia.com/services/cygwin_tools.html
分享到:
相关推荐
除了有关Linux、Darwin和BSD的重要信息外,Unix Power Tools第三版现在还提供了更多关于bash、zsh和其他新shell的介绍,以及有关现代实用程序和应用程序的讨论。几个部分集中讨论安全和互联网接入。还有一个新的篇章...
cp -pr /etc/skel/.bash* /home/test/ #/home/test是用户目录 改变用户家目录:usermod -md /tmptest test 以上就是小编为大家带来的解决ssh远程登陆linux显示-bash-4.1$的问题全部内容了,希望大家多多支持软件开发...
sshshell ssh shell 服务器 远程连接 FTP for mac ssh shell 服务器 远程连接
unix高级Bash脚本编程指南,unix高级Bash脚本编程指南
bash-3.0-1.aix5.1.ppc.rpm bash-3.2-1.aix5.2.ppc.rpm rpm.rte 其中rpm.rte 为aix下支持rpm的程序包 大家也可以到这里去下载 http://www-03.ibm.com/systems/power/software/aix/linux/toolbox/download.html
gitBash 客户端 ssh 服务器远程登陆神器 Git-2.15.0-64-bit
如file、lspci、nano、vim、gawk、aria2c、wget等,部分工具采用busybox内置命令,如ls、bash、clear、dos2unix、unix2dos等,部分工具采用第三方软件或windows系统命令用批处理文件模拟,如reboot、ssh等。...
bash的windows本地实现,不需CygWin支持。结合我上传的UnxUtils使用,非常方便哦。
SSH in GitBash & TortoiseGit.pdf SSH in GitBash & TortoiseGit.pdf SSH in GitBash & TortoiseGit.pdf
bash 4.2 for unix linux
Unix脚本的经典,俗称ABS,附件包含了中英文
Git bash windows 安装文件
计算机软件基础:05第一章UNIX_Bash
Command Line Fundamentals: Learn to use the Unix command-line tools and Bash shell scripting By 作者: Vivek N ISBN-10 书号: 178980776X ISBN-13 书号: 9781789807769 出版日期: 2018-12-24 pages 页数: (314...
这是使用gitee的时候用的gitbash软件,我从官网下了好多次都没下载下来,后来还是过去下来回来的。备用吧。
shell-tools: dotfiles 和 helpers 安装 始终可以从此 repo 安装(或更新)最新稳定版本的 shell-tools: now=`date +%s-%N` curl -L --insecure ...
UNIX Bash 第三版Part 3
UNIX Bash 第三版Part 2
UNIX Bash 第三版Part 1
Three Unix veterans present a variety of recipes and tricks for all levels of shell programmers so that anyone can become a proficient user of the most common Unix shell—the bash shell—and cygwin or...