博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Windows command tools
阅读量:7290 次
发布时间:2019-06-30

本文共 8086 字,大约阅读时间需要 26 分钟。

  • Babun - a windows shell you will love
  • Cmder - Portable console emulator for Windows
  • Settings
  • Nodejs
  • FAQ
  • Reference

Babun - a windows shell you will love

Cmder - Portable console emulator for Windows

Settings

打开 Babun, 执行 babun check,检查安装是否成功。

{ ~ }  » babun check                                                                         ~Executing babun checkPrompt speed      [OK]Connection check  [OK]Update check      [OK]Cygwin check      [OK]

babun check 用于判断环境是否正确

babun update 用于判断是否有新的更新包

babun 自带 pact 包管理

{ ~ }  » pact --helppact: 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

.minttyrc 配置文件:

BackgroundColour=57,56,57ForegroundColour=238,238,238CursorColour=238,238,238Black=0,0,0BoldBlack=89,89,89Red=229,32,130BoldRed=238,105,171Green=130,229,32BoldGreen=171,238,105Yellow=229,130,32BoldYellow=238,171,105Blue=32,130,229BoldBlue=105,171,238Magenta=130,32,229BoldMagenta=171,105,238Cyan=32,229,130BoldCyan=105,238,171White=238,238,238BoldWhite=255,255,255Transparency=mediumOpaqueWhenFocused=noCursorType=blockBoldAsFont=yesAllowBlinking=noColumns=120Rows=40Font=Source Code Pro MediumFontHeight=12CursorBlinks=noBellTaskbar=no

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

  1. Clone this repository into $ZSH_CUSTOM/plugins (by default ~/.oh-my-zsh/custom/plugins)

    $ git clone git://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions
  2. Add the plugin to the list of plugins for Oh My Zsh to load:

    plugins=(zsh-autosuggestions)
  3. Start a new terminal session, or:

    $ source ~/.zshrc

  1. Grab a copy of autojump:

    $ git clone git://github.com/joelthelion/autojump.git $ZSH_CUSTOM/plugins/autojump && cd $ZSH_CUSTOM/plugins/autojump

  2. Run the installation script and follow on screen instructions.

    ./install.py or ./uninstall.py

  3. Please manually add the following line(s) to ~/.zshrc:

    [[ -s /home/gongyuqi/.autojump/etc/profile.d/autojump.sh ]] && source /home/gongyuqi/.autojump/etc/profile.d/autojump.sh

    autoload -U compinit && compinit -u

Please restart terminal(s) before running autojump.

  1. If you prefer a manual installation, please use the following instructions:

    $ git clone git://github.com/petervanderdoes/gitflow.git $ZSH_CUSTOM/plugins/gitflow && cd $ZSH_CUSTOM/plugins/gitflow
  2. Then, you can install git-flow, using:

    $ sudo make install

  1. If you prefer a manual installation, please use the following instructions:

    $ git clone https://github.com/tj/git-extras.git $ZSH_CUSTOM/plugins/git-extras && cd $ZSH_CUSTOM/plugins/git-extras
  2. Then, you can install git-extras, using:

    $ sudo make install

Note: If you are a zsh user, you may want to 'source /home/gongyuqi/.oh-my-zsh/custom/plugins/git-extras//etc/git-extras-completion.zsh' and put this line into ~/.zshrc to enable zsh completion

  1. If you prefer a manual installation, please use the following instructions:

    $ git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $ZSH_CUSTOM/plugins/zsh-syntax-highlighting
  2. Add the plugin to the list of plugins for Oh My Zsh to load:

    plugins=(zsh-syntax-highlighting)
  3. Start a new terminal session. or:

    $ source ~/.zshrc

  1. If you prefer a manual installation, please use the following instructions:

    $ git clone https://github.com/zsh-users/zsh-completions $ZSH_CUSTOM/plugins/zsh-completions
  2. Add the plugin to the list of plugins for Oh My Zsh to load:

    plugins=(zsh-completions)
  3. Start a new terminal session. or:

    $ source ~/.zshrc

  1. If you prefer a manual installation, please use the following instructions:

    $ curl -O https://github.com/AlDanial/cloc/archive/v1.72.tar.gz ~/cloc && tar -zxvf v1.72.tar.gz && cd ~/cloc
  2. Then, you can install git-extras, using:

    $ sudo make install

or, It is recommended to install cloc with choco:

$ choco install cloc

It is recommended to install httpie with pip:

# Make sure we have an up-to-date version of pip and setuptools:$ pip install --upgrade pip setuptools$ pip install --upgrade httpie

It is recommended to install cheat with pip:

$ [sudo] pip install cheat

将 babun 添加到 cmder:

  1. Add new task in CMDER settings

    `Win + Alt + P` to open settings, then go to `Startup > Tasks`.Then hit the `+` symbol on the bottom to create a new task
  2. Rename the task to Babun (or whatever you want)
  3. Add this command in Task Parameters:

    /icon "%userprofile%\.babun\cygwin\bin\mintty.exe" /dir "%userprofile%"
  4. Add this command in Commands:

    %userprofile%\.babun\cygwin\bin\mintty.exe -o Transparency=0 /bin/env CHERE_INVOKING=1 /bin/zsh.exe

"Open Cmder Here" in context menu

To add an entry in the Windows Explorer context menu to open Cmder in a specific directory, paste this into a OpenCmderHere.reg file and double-click to install it.

Windows Registry Editor Version 5.00[HKEY_CLASSES_ROOT\Directory\Background\shell\Cmder]@="Open Cmder Here"[HKEY_CLASSES_ROOT\Directory\Background\shell\Cmder\command]@=hex(2):25,00,43,00,4d,00,44,00,45,00,52,00,5f,00,49,00,4e,00,\  53,00,54,00,41,00,4c,00,4c,00,5f,00,44,00,49,00,52,00,25,00,5c,00,43,00,6d,\  00,64,00,65,00,72,00,2e,00,65,00,78,00,65,00,20,00,2f,00,53,00,54,00,41,00,\  52,00,54,00,20,00,22,00,25,00,76,00,22,00,00,00

Cmder 中文显示问题(1.3以上)

文字重叠

取消勾选设置中的Monospace选项

中文乱码

在Settings > Startup > Environment里添加:set LANG=zh_CN.UTF8

Nodejs

This is not the same thing as nvm, which is a completely separate project for Mac/Linux only.

Tip:安装目录不要出现空格

settings.txt

root: yourpath\nvmpath: yourpath\nodejsarch: 64proxy: nonenode_mirror: http://npm.taobao.org/mirrors/node/npm_mirror: https://npm.taobao.org/mirrors/npm/

配置系统环境变量,

%NVM_HOME%: yourpathnvm

%NVM_SYMLINK%: yourpathnodejs
%NPM_HOME%: yourpathnpm

添加 npm 命令

dos2unix '/cygdrive/c/Program Files/nodejs/npm'cygstart /bin/zsh

Install

$ npm install -g nrm

Usage

Usage: nrm [options] [command]  Commands:ls                           List all the registriesuse 
Change registry to registryadd
[home] Add one custom registrydel
Delete one custom registryhome
[browser] Open the homepage of registry with optional browsertest [registry] Show the response time for one or all registrieshelp Print this help Options:-h, --help output usage information-V, --version output the version number

FAQ

出现以下问题:

compdef: unknown command or service: gitcompdef: unknown command or service: grepcompdef: unknown command or service: git

解决方案:

compaudit | sudo xargs chmod g-wcompaudit | sudo xargs chown rootrm ~/.zcompdump*compinit

出现以下问题:

66835 error Error: EPERM: operation not permitted, rename 'D:\Desktop\work\website\node_modules\.staging\abbrev-67f8252c' -> 'D:\Desktop\work\website\node_modules\abbrev'66835 error     at Error (native) parent: 'website' }66836 error Please try running this command again as root/Administrator.66837 verbose exit [ -4048, true ]

解决方案:

使用管理员权限运行 cmd,node.exe 设置属性为, 以管理员身份运行此程序

出现以下问题:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@Permissions 0744 for '/home/geek/.ssh/id_rsa' are too open.It is recommended that your private key files are NOT accessible by others.This private key will be ignored.bad permissions: ignore key: /home/geek/.ssh/id_rsa

解决方案:

sudo chmod 600 ~/.ssh/id_rsasudo chmod 600 ~/.ssh/id_rsa.pub

出现以下问题:

CreateProcess Failed with error 740: ��ֹ�����������

解决方案:

由于使用了 nvm-windows , 需要修改 webStormnode 依赖。 e.g. D:\yourpath\nvm\v6.11.2\node.exe

Reference

转载地址:http://qacjm.baihongyu.com/

你可能感兴趣的文章
java 类加载机制总结
查看>>
HDU 4417 Super Mario(2012杭州网络赛 H 离线线段树)
查看>>
62. Unique Paths不同路径
查看>>
观察者模式
查看>>
容器和算法2 - C++快速入门48(完)
查看>>
Survival Model介绍
查看>>
关于对handle的理解
查看>>
php+mysql将大数据sql文件导入数据库
查看>>
记第一次写博客
查看>>
绝对定位元素被遮挡
查看>>
用Python监听鼠标和键盘事件
查看>>
Interface和Abstract class区别
查看>>
[Python爬虫] 之十:Selenium +phantomjs抓取活动行中会议活动
查看>>
内存溢出和内存泄漏
查看>>
iis7.5 aspx,ashx的mime类型
查看>>
unity纯粹物理驱动方式
查看>>
关于前端设置cookie
查看>>
日常工作记录
查看>>
浅谈WebService的调用
查看>>
centos 7.2 离线安装 gcc
查看>>