The command line tool babun in windows, the command line babun

Source: Internet
Author: User

The command line tool babun in windows, the command line babun
What is babun?

Babun is a third-party shell on windows. On this shell, you can use almost all the commands on linux and unix, which can almost replace the windows shell. The official question is A Windows shell you will love!

 

Several Characteristics of babun

No administrator permission is required to use babun.
Advanced Installation Package Manager (similar to apt-get or yum on linux)
Cygwin and many plug-ins are pre-configured
256-color compatible Console
HTTP (S) Proxy Support
Plug-in-Oriented Architecture
You can use it to configure your git
Integrated with oh-my-zsh
Automatic Upgrade
Supports shell programming and built-in VIM.

Cygwin

The core of babun includes a pre-configured Cygwin. Cygwin is a good tool, but it has a lot of tips to save you a lot of time. Babun solves many problems. It contains many important software packages that you can use immediately.

Package management:
The babun package management input in shell: pact, which is similar to: apt-get or yum. It is very convenient to manage software packages, install, upgrade, search, and delete, which makes your province a lot of trouble, shell input pact-help to get help information.

Shell

Babun's shell has been adjusted to achieve the best user experience. babun has two shells that will be used immediately after configuration (zsh is used by default). babun's shell has the following features:

Syntax highlighting
Unix tools
Software development tools
Git-semantic prompt
Custom scripts and aliases
Wait .........

Console

Babun supports HTTP proxy. You only need to add the address and the creden of the HTTP proxy server. The execution source of the folder where the babunrc file is located enables the HTTP proxy. Currently, SOCKS proxy is not supported.

Developer Tools

Babun provides a variety of convenient tools and scripts, making your development work easier and has the following functions:

Programming Languages (python, Perl, etc)
Git (various alias adjustments)
UNIX tool (grep, wget, curl, etc)
Vcs (svn, git)
Oh-my-zsh
Custom scripts (pbcopy, pbpaste, babun, etc)

Babun official website link: http://babun.github.io/

What is cmder

Cmder is a multi-label command line tool in windows. It can easily create multiple command lines, including cmd, cmd admin, powershell, and powershell admin.

Install cmder

Download: http://cmder.net/

Cmder is an out-of-the-box software and will not be described in detail. For details about how to use it, refer to the instructions on the official website.

Babun Installation

Download: http://babun.github.io/

Default installation

After the download is complete, decompress babun and double-click the install. bat script in the directory (administrator privilege required) for installation. The installation is completed in a few minutes.%userprofile%\.babunDirectory.

Custom installation location

Use the cmd command line to specify the parameter/t or/target when executing install. bat to specify the installation directory.

Run:babun.bat /t c:\babun

After installation, A. babun directory is generated under the c: \ babun directory, where all babun files are located. Note that the installation directory should not contain spaces, which is required by cygwin.

The test is installed successfully.

After the installation is complete, the following two commands are generally required to check

Babun check (used to determine whether the environment is correct) babun update (used to determine whether a new update package exists)
Babun Configuration

Default root directory

%userprofile%\.babun\cygwin\home\Mike
Windows cmd built-in commands display Chinese Characters

Babun default encoding is UTF-8, while windows cmd command output is GBK encoding, so in Babun run ipconfig and other windows commands, Chinese will be a lot of garbled.


Solution: Right-click options-text in the upper right corner of the shell (mintty) that comes with babun, select default or GBK in character set, and then display Chinese characters normally when executing commands embedded in cmd such as ipconfig.

If you change Babun encoding to GBK, the Chinese output of the command is normal, but PS1 will contain a garbled character.



Remove command prompt garbled

Babun has two built-in shells. The default is zsh, and the other is bash. After being set to Chinese, there will be a garbled character at the end of the command prompt. It looks bad. You need to modify the PS1 variable to remove it. Replace garbled characters with:>

Bash

vi /usr/local/etc/babun.bashPS1="\[\033[00;34m\]{ \[\033[01;34m\]\W \[\033[00;34m\]}\[\033[01;32m\] \$( git rev-parse --abbrev-ref HEAD 2> /dev/null || echo "" ) \[\033[01;31m\]>>\[\033[00m\]"

Zsh

vi ~/.oh-my-zsh/custom/babun.zsh-themePROMPT='%{$fg[blue]%}{ %c } \%{$fg[green]%}$(  git rev-parse --abbrev-ref HEAD 2> /dev/null || echo ""  )%{$reset_color%} \%{$fg[red]%}%(!.#.>>)%{$reset_color%} '

In this way, the command prompt becomes:{ ~ } >>

Note: After you change the encoding to GBK, garbled characters will appear in the Chinese File Name of the ls command. It is best to use UTF-8 encoding in the Babun environment, ipconfig and other windows commands with cmder or default cmd to execute the line.

Integrate Babun into ConEmu/cmder

In the upper-right corner of the cmder window, right-click Settings> Startup> Tasks, and add a new task named babun.

Fill in Task parameters

/icon "%userprofile%\.babun\cygwin\bin\mintty.exe" /dir "%userprofile%"

Enter any of the following in Commands:

# ZSH % userprofile % \ is used by default \. babun \ cygwin \ bin \ mintty.exe/bin/env CHERE_INVOKING = 1/bin/zsh.exe # use custom mintty to configure % userprofile % \. babun \ cygwin \ bin \ mintty.exe-t "% userprofile % \. babun \ cygwin \ etc \ minttyrc"

Save and select Babun when creating a new terminal.

Configure personalized mintty
vim ~/.minttyrcCursorType=blockTerm=xterm-256colorFont=Source Code Pro SemiboldFontHeight=10
Development Environment Configuration

Pip

Babun has built-in interpreters such as Python and Perl. The python that comes with cygwin does not have pip. You need to install it manually.

Simply execute the following command.

wget https://bootstrap.pypa.io/get-pip.py -O - | python

With pip, you can freely install things such as ipython and all-embracing class libraries.

Common plug-ins

By default, Babun has installed Oh My ZSH. Here you can install some plug-ins based on your own situation. For details, refer to how to use Oh-My-Zsh to create your Super Terminal.

Use Package Manager

Babun provides a package management tool called pact, similar to apt-get or yum on linux.

Pact syntax

pact: Installs and removes Cygwin packages.Usage:  "pact install " to install given packages  "pact remove " to remove given packages  "pact update " to update given packages  "pact show" to show installed packages  "pact find " to find packages matching patterns  "pact describe " to describe packages matching patterns  "pact packageof " to locate parent packages  "pact invalidate" to invalidate pact caches (setup.ini, etc.)Options:  --mirror, -m  : set mirror  --invalidate, -i       : invalidates pact caches (setup.ini, etc.)  --force, -f : force the execution  --help  --version

Pact is easy to use and will not be detailed!

Common Software Installation

# Install tmuxpact install tmux # install screenpact install screen # install zippact install zip # install svnpact install subversion # install lftp command pact install lftp # install p7zip command pact install p7zip # socks https Based on openssh proxy pact install connect-proxy # install the basic linux Command Line tool more/col/whereis and other commands pact install util-linux # install dig command pact install bind-utils # install Telnet and other common networks command pact install inetutils # install python Environment pact install python-crypto

This package is easy to manage and easy to use. Install it as needed!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.