适用于 Windows 的便携式类 Unix 环境

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3552922/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 15:05:58  来源:igfitidea点击:

Portable unix-like environment for Windows

windowsunixvim

提问by magoo

I am trying to put together a portable set of files/scripts that will enable me to mimic a unix like environment on Windows.

我正在尝试将一组可移植的文件/脚本放在一起,使我能够在 Windows 上模拟类似 Unix 的环境。

I do not want to install anything. The setup needs to be able to live on a thumbdrive for example. Currently I am using UnxUtilsto provide grep, and more. Im adding these to the Windows PATH environment variable in the current console session by

我不想安装任何东西。例如,设置需要能够存在于拇指驱动器上。目前我正在使用UnxUtils来提供 grep 等等。我将这些添加到当前控制台会话中的 Windows PATH 环境变量中

cd <pathToUnxUtils>
path = %PATH%;%CD%

For Vim (my preferred editor) I am using the "Win32 console executable" (http://www.vim.org/download.php#pc) vim.exe. If I have that in a drive such as \vim\vim73\vim.exe then $VIMRUNTIME is \vim\vim73, which is where my vimrc lives.

对于 Vim(我的首选编辑器),我使用的是“Win32 控制台可执行文件”(http://www.vim.org/download.php#pc)vim.exe。如果我在诸如 \vim\vim73\vim.exe 这样的驱动器中有它,那么 $VIMRUNTIME 就是 \vim\vim73,这是我的 vimrc 所在的位置。

I am trying to get some syntax highlighting and indenting going next, which I believe I need to add the appropriate .vim scripts to $VIMRUNTIME\syntax and $VIMRUNTIME\indent but it does not seem to work.

我正在尝试接下来进行一些语法突出显示和缩进,我相信我需要将适当的 .vim 脚本添加到 $VIMRUNTIME\syntax 和 $VIMRUNTIME\indent 但它似乎不起作用。

I am using the console executible instead of something like gVim (which probably does more of what I want "out-of-the-box") because I want to be able to send commands to the same shell using the ! command. gVim does not allow that (correct me if I am wrong)

我正在使用控制台可执行文件而不是 gVim(它可能做更多我想要的“开箱即用”),因为我希望能够使用 ! 命令。gVim 不允许(如果我错了,请纠正我)

Lastly, has anyone experienced trouble with "tail" from UnxUtils working on Vista?

最后,有没有人遇到过 UnxUtils 在 Vista 上工作的“尾巴”问题?

I know this probably seems like a stupid way to go about things, but I am really trying to make this work. Id be happy with getting these bits of Unix goodness going on Windows.

我知道这似乎是一种愚蠢的处理方式,但我真的在努力使这项工作发挥作用。我很高兴在 Windows 上获得这些 Unix 优点。

Thanks for any help

谢谢你的帮助

回答by slebetman

Check out cygwin portable: http://symbiosoft.net/cygwinportable

查看 cygwin 便携式:http: //symbiosoft.net/cygwinportable

Or this guide on how to make regular cygwin run on portable devices: http://sites.google.com/site/devinsezer/Home/software/portable-cygwin

或者有关如何在便携式设备上运行常规 cygwin 的指南:http: //sites.google.com/site/devinsezer/Home/software/portable-cygwin

The advantage of cygwin over a thin emulation layer like UnxUtils is that it includes a fully working X11 server so you can even run GUI unix apps if you need to (gitk for example, if you're using git)

cygwin 相对于像 UnxUtils 这样的薄仿真层的优势在于它包含一个完全工作的 X11 服务器,因此您甚至可以在需要时运行 GUI unix 应用程序(例如 gitk,如果您使用的是 git)

回答by paxdiablo

I've had some troubles with UnxUtilsbefore re currency - they don't seem to be as up to date as the GnuWin32stuff (for example, TextUtilsat 2.1 instead of 5.3).

UnxUtils在重新通货之前遇到了一些麻烦- 它们似乎不像 GnuWin32 的东西那样最新(例如,TextUtils在 2.1 而不是 5.3)。

I've simply downloaded the executablesand required libraries for what I've needed (no install needed if you avoid the setup packages, just copy and go).

我只是下载了我需要的可执行文件和所需的库(如果您避免安装包,则不需要安装,只需复制并运行)。

If you click on the package names on the left of that second link above (not the "Setup" on the right), it allows you to download both the executable plus all dependencies on a single page.

如果您单击上面第二个链接左侧的包名称(而不是右侧的“安装程序”),它允许您在单个页面上下载可执行文件和所有依赖项。

My particular needs for a recent project were met with sedand about four DLL files, no installation, no impinging on the environment or registry. In short, ideal for running from a memory stick or standalone CD.

我最近对一个项目的特殊需求得到了满足,sed大约有四个 DLL 文件,无需安装,不会影响环境或注册表。简而言之,非常适合从记忆棒或独立 CD 运行。

I must, at some point, put together a CD with the entire suite on it. I used to carry around CygWin but the necessity to install was a pain.

在某个时候,我必须将一张 CD 与整个套件放在一起。我曾经随身携带 CygWin,但安装的必要性很痛苦。

回答by Rafareino

I'm using MobaXterm from Mobatek.

我正在使用 Mobatek 的 MobaXterm。

http://mobaxterm.mobatek.net/

http://mobaxterm.mobatek.net/

It's not a complete envtheitroadement, but is quite suficcient. Just download and run!

这不是一个完整的环境,但已经足够了。只需下载并运行!

Tabbed interface

选项卡式界面

It have an (ba)sh, with X, sed, grep, awk, rsync, wget, sftp, scp; and some extra plugins (standalone files to put in the same dir) to VIM, EMACS, perl python, Gcc, gdb, mplayer, svn, git, lua graphviz...

它有一个 (ba)sh,带有 X、sed、grep、awk、rsync、wget、sftp、scp;和一些额外的插件(放在同一个目录中的独立文件)到 VIM、EMACS、perl python、Gcc、gdb、mplayer、svn、git、lua graphviz ......

It still provides many protocols (RDP, VNC, SSH, telnet, rsh, FTP, SFTP and XDMCP).

它仍然提供了许多协议(RDP、VNC、SSH、telnet、rsh、FTP、SFTP 和 XDMCP)。

回答by yasouser

Cygwinand MSYSprovides all you need. I have used both and I think MSYS runs faster than Cygwin on a Windows machine. Cygwin emulates the UNIX environment whereas MSYS is port of the GNU utils to Windows.

CygwinMSYS提供您所需的一切。我两者都用过,我认为 MSYS 在 Windows 机器上的运行速度比 Cygwin 快。Cygwin 模拟 UNIX 环境,而 MSYS 是 GNU 实用程序到 Windows 的端口。

Another option to get portable GNU utils is to install Portable MsysGit.

获得可移植 GNU实用程序的另一个选择是安装Portable MsysGit

回答by Martin Beckett

Either MSYSor CHwill do that, there is a specifically portable VIM at portable apps

要么MSYSCH能做到这一点,有在具体便携VIM便携式应用

回答by x0n

http://www.cygwin.com/is very popular.

http://www.cygwin.com/非常受欢迎。

update: oh, never mind - I don't think it can be xcopy deployed.

更新:哦,没关系 - 我认为它不能被 xcopy 部署。

-Oisin

-Oisin

回答by intrepidhero

I've had good luck with running Cygwin on a thumbdrive. I haven't run it on machines where older versions are installed. But I don't expect to have that problem often.

我很幸运在拇指驱动器上运行 Cygwin。我还没有在安装了旧版本的机器上运行它。但我不希望经常遇到这个问题。

Here is what I did: http://fadedbluesky.com/2011/portable-cygwin/

这是我所做的:http: //fadedbluesky.com/2011/portable-cygwin/