常用的unix命令

  • 找出匹配的文件并批量执行命令

    1
    $ find ./images/scrm/leftNav -iname '._*.png' -exec rm {} ;
  • 查找目录

    1
    $ find ./ -name [directoryname] -type d
  • 在指定目录下查找字符串

    1
    $ grep -r [string] [path]
  • 在服务器之间拷贝文件

    1
    $ scp -P [port]  [file]    [user]@[address]:[path]
  • 从终端输入并写到指定文件

    1
    $ cat > [filename]
  • 查看项目里npm依赖版本号

    1
    $ npm list --depth=0 |grep [name]
  • 网络相关

    1
    2
    3
    $ host github.com

    $ nsloopup github.com