Что такое Cygwin

Вам когда-нибудь приходилось после linux’а пользоваться командной строкой Windows? Мне, да. Очень не привычно. Многие команды называются по-другому. Например, аналог ls в Windows это dir. Стилистика передачи аргументов у местного интерпретатора другая. А многих возможностей, которые дают линуксовые утилиты тут просто нет. Как-же получить аналогичную linux среду в windows? Это можно сделать установив Cygwin.

Знакомство с развернутой системой

Во-первых у cygwin по-умолчанию устанавливается свой эмулятор терминала, с которым работать по-удобнее, чем с командной строкой Windows.
emulator
Тут у нас первые проблемы. Как видите, windows утилиты, в том числе и cmd.exe печатают текст в oem-866, а эмулятор cygwin читает текст в utf-8. Если переключить кодировку на 866 кодовую страницу, то последствия этого действия еще хуже.
emulator-866
cygwin интерпретировал русскоязычное имя в unicode кодировке, как строку в 866 кодировке и в итоге решил создать новую директорию /home/╨Ф╨╝╨╕╤В╤А╨╕╨╣. Так что лучше все оставить как было и, при возможности обходиться cygwin утилитами. В случае, если вам нужно запустить командную оболочку без эмулятора терминала, запустите пакетный файл Cygwin.bat.
В данном случае, cygwin установлена в папке C:\cygwin64\. Узнать преобразуются пути из unix-path в windows пути нам поможет утилита cygpath.
$ cygpath -w `pwd`
C:\cygwin64\home\Дмитрий

$ cygpath -w /
C:\cygwin64

$ cygpath 'C:\cygwin64'
/

$ cygpath 'C:\cygwin64\home\Дмитрий'
/home/Дмитрий

А как получить доступ к диску C:, если все пути транслируются в C:\cygwin64\.
Все просто. В дирректории /cygdrive есть точки монтирования, которые по имени соответствуют томам windows.
$ cygpath 'C:\'
/cygdrive/c

$ cygpath -w /cygdrive/c/somedir
C:\somedir

Cygpath так-же успешно транслирует обращения к этой точке монтирования в Windows пути.
Кстати, существование такой утилиты как cygpath показывает, почему с cygwin вы, при возможности, должны пользоваться только ее утилитами. Если, вам нужно запустить java VM, а она понимает только Windows пути, вам придется cygwin путь преобразовать при запуске:
$ java -jar `cygpath -w '/opt/some.jar'`
Из этого следует, что многие скрипты из linux’а нельзя просто взять и запустить в windows. Нужно иногда постараться перенести скрипт. Более того, не все утилиты командной строки будут работать.

Больше возможностей

SSH

Вы можете поставить клиент и сервер OpenSSH — это позволит вам получить удаленный доступ к командной оболочке bash, с другого компьютера или, даже с телефона, например, с помощью JuiceSSH. Так-же вы получите удаленный доступ к своим файлам по протоколу SFTP(хотя на винде проще расшарить каталог, доступный по SMB).

Программирование

В комплект входят известные компиляторы, такие как Clang или GCC, интерпретаторы языков Python, Perl, PHP, Ruby и др. Вы можете собрать POSIX-совместимые программы под винду.

Текстовые редакторы

Интерактивные редакторы — vim, nano, emacs.
Не интерактивные редакторы, подходящие для использования в скриптах — sed, awk.

Итог

Если вы скучаете по возможностям linux в винде, возможно, стоит поставить эту штуку себе.

160 комментариев к “Что такое Cygwin

  1. Wow that was odd. I just wrote an extremely long comment but after I clicked submit my comment didn’t appear. Grrrr… well I’m not writing all that over again. Anyhow, just wanted to say excellent blog!

  2. This is the right website for anybody who wishes to understand this topic. You realize so much its almost tough to argue with you (not that I personally would want to…HaHa). You certainly put a brand new spin on a subject that’s been discussed for a long time. Excellent stuff, just wonderful.

  3. An intriguing discussion is definitely worth comment. I believe that you need to publish more on this topic, it might not be a taboo subject but usually people do not talk about these subjects. To the next! Best wishes.

  4. I’m impressed, I have to admit. Rarely do I encounter a blog that’s both educative and entertaining, and without a doubt, you have hit the nail on the head. The problem is something not enough folks are speaking intelligently about. I am very happy I came across this during my hunt for something relating to this.

  5. Oh my goodness! Incredible article dude! Many thanks, However I am having troubles with your RSS. I don’t understand the reason why I can’t subscribe to it. Is there anyone else having the same RSS issues? Anyone that knows the answer can you kindly respond? Thanx!!

  6. When I initially commented I appear to have clicked on the -Notify me when new comments are added- checkbox and from now on every time a comment is added I get four emails with the exact same comment. Perhaps there is a way you are able to remove me from that service? Thanks.

  7. Hi there! This article could not be written any better! Looking through this post reminds me of my previous roommate! He continually kept preaching about this. I will forward this article to him. Fairly certain he will have a good read. Many thanks for sharing!

  8. Hi, I do think this is an excellent blog. I stumbledupon it 😉 I will return yet again since i have bookmarked it. Money and freedom is the greatest way to change, may you be rich and continue to guide other people.

  9. Uncovering Sugar Protector has actually been a game-changer for me, as I’ve constantly been vigilant regarding handling my blood sugar level degrees.
    With this supplement, I feel encouraged to take charge of my wellness, and my most recent medical examinations have actually
    reflected a substantial turnaround. Having a credible ally in my edge supplies me with
    a sense of security and reassurance, and I’m deeply happy for the profound difference Sugar Protector has made in my
    wellness.

  10. Finding Sugar Protector has been a game-changer for me, as I have actually constantly been vigilant
    regarding handling my blood sugar level levels. With this supplement, I feel empowered
    to organize my health and wellness, and my latest clinical exams have mirrored a significant turnaround.
    Having a trustworthy ally in my corner provides me with a sense of security and peace of mind,
    and I’m deeply glad for the extensive difference Sugar Protector has
    actually made in my well-being.

  11. Including Sugar Protector right into my everyday routine overall health.
    As someone that focuses on healthy consuming, I value the extra security this supplement supplies.
    Since starting to take it, I’ve seen a marked improvement in my power levels and a considerable decrease in my wish for unhealthy snacks such a such
    an extensive influence on my life.

  12. Discovering Sugar Defender has been a game-changer for me,
    as I have actually constantly been vigilant concerning handling my blood glucose degrees.
    With this supplement, I really feel encouraged to take charge
    of my health and wellness, and my most recent clinical exams have mirrored a significant turn-around.
    Having a trustworthy ally in my edge gives me with a sense of security and reassurance, and I’m deeply appreciative for the extensive difference Sugar Defender has
    actually made in my wellness.

  13. Finding Sugar Protector has been a game-changer
    for me, as I have actually constantly been vigilant regarding managing my blood
    sugar level degrees. With this supplement, I really feel equipped to take charge
    of my health, and my most recent medical check-ups have actually shown a substantial turn-around.
    Having a credible ally in my corner supplies me with a
    complacency and reassurance, and I’m deeply thankful for the profound distinction Sugar Protector has actually made in my
    well-being.

  14. Can I just say what a comfort to uncover someone who truly knows what they’re discussing on the web. You actually realize how to bring an issue to light and make it important. More and more people ought to look at this and understand this side of your story. I was surprised you are not more popular because you certainly possess the gift.

  15. We review the descriptive epidemiology of the disease, focusing on some of the key elements of the geographical and temporal variations in incidence and mortality in each world region buy priligy 30 mg x 10 pill The most result can be found in the viewpoint this riverside those thinking of taking this medication

  16. Hi there! Do you know if they make any plugins to assist with Search Engine Optimization? I’m
    trying to get my website to rank for some targeted keywords but I’m not seeing very good success.

    If you know of any please share. Kudos! You can read similar art
    here: Wool product

  17. Good post. I learn something new and challenging on blogs I stumbleupon every day. It will always be interesting to read through content from other writers and use a little something from their sites.

  18. Right here is the perfect web site for anyone who wants to find out about this topic. You understand so much its almost hard to argue with you (not that I actually would want to…HaHa). You certainly put a brand new spin on a topic that has been written about for years. Wonderful stuff, just excellent.

  19. Aw, this was an exceptionally nice post. Spending some time and actual effort to generate a top notch article… but what can I say… I hesitate a lot and never manage to get anything done.

  20. Right here is the right website for anyone who wishes to find out about this topic. You understand so much its almost tough to argue with you (not that I really would want to…HaHa). You definitely put a fresh spin on a subject that has been discussed for years. Wonderful stuff, just wonderful.

  21. Sugar Defender Sugarcoating Defender to my everyday routine was among the very best choices I have actually made
    for my health. I beware about what I consume, yet this supplement adds an added
    layer of support. I feel more consistent throughout the day, and my
    cravings have actually reduced considerably. It behaves to have something so
    easy that makes such a huge distinction! sugar defender ingredients

  22. sugar defender official website For
    several years, I’ve fought uncertain blood glucose swings that
    left me really feeling drained and tired. Yet considering that incorporating Sugar my
    energy levels are currently secure and constant,
    and I no more hit a wall in the mid-days. I appreciate that it’s a mild, natural technique that doesn’t
    come with any unpleasant side effects. It’s truly
    changed my day-to-day live.

  23. sugar defender reviews
    Discovering Sugar Defender has been a game-changer for me,
    as I have actually always been vigilant about managing my
    blood glucose levels. With this supplement, I feel equipped to take charge of
    my health, and my latest clinical examinations have reflected a substantial turn-around.

    Having a credible ally in my corner gives me with a sense of
    security and reassurance, and I’m deeply happy for the profound difference Sugar Protector has
    actually made in my wellness. Sugar Defender Reviews

  24. sugar defender ingredients Uncovering Sugar Defender has been a
    game-changer for me, as I have actually always been vigilant about handling my blood sugar level levels.
    With this supplement, I feel encouraged to organize my health, and my newest clinical exams have reflected a
    substantial turnaround. Having a reliable ally in my edge supplies me with a sense of security and reassurance,
    and I’m deeply glad for the profound difference Sugar Protector has actually made
    in my wellness. sugar defender

  25. sugar defender official website I
    have actually struggled with blood sugar fluctuations for years,
    and it truly influenced my power degrees throughout the day.
    Considering that beginning Sugar Protector, I really feel more balanced and alert, and
    I don’t experience those mid-day plunges any longer!

    I enjoy that it’s a natural remedy that works with no extreme adverse effects.
    It’s genuinely been a game-changer for me sugar defender

  26. Hi, I do think this is a great blog. I stumbledupon it 😉 I may come back once again since i have bookmarked it. Money and freedom is the greatest way to change, may you be rich and continue to guide others.

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *

*