跳转至

命令行

系统

find

在 Mac 上缩小搜索结果范围

dscl

sudo /usr/sbin/DevToolsSecurity -enable

sudo dscl . append /Groups/_developer GroupMembership $(whoami)

sed

grep -l "尔云梯" -R * | xargs sed -i "s/尔云梯/云原生/g"

sed -i.bak 's/rubygems.org/gems.ruby-china.com/g' Gemfile

egrep -rl 'space.html' docs/* | xargs -I@ sed -i '' 's/space/readme/g' @

zip

zip -r <dir.zip> <dir>

tar


git

# or create a new repository on the command line
echo "# go-resume" >> README.md
git init
git add README.md
git commit -m "first commit"
git branch -M main
git remote add origin git@github.com:zhenyuanlau/go-resume.git
git push -u origin main

# or push an existing repository from the command line
git remote add origin git@github.com:zhenyuanlau/go-resume.git
git branch -M main
git push -u origin main

xattr

xattr -cr /Applications/Chromium.app

Docker

docker inspect localstack/localstack | jq '.[0].Architecture'

网络

nc

nc -U  ~/Library/Containers/com.docker.docker/Data/debug-shell.sock

nsenter

nsenter -t 1 -m -u -n -i bash

brctl

brctl show

ss

ss -ltup

dig

dig +short myip.opendns.com @resolver1.opendns.com

nslookup

nslookup www.growingio.com

ssh

ssh-copy-id -i ~/.ssh/id_rsa.pub ubuntu@192.168.205.64

dscacheutl

sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder

调试

Jshell

jshell --class-path $(ls -d lib/* | tr '\n' ':')

gRPC CLI

参见 gRPC CLI Tool

# Service 列表
grpc_cli ls ${host}:${port}

# Service 定义

grpc_cli ls ${host}:${port} -l ${service}

# 请求参数类型

grpc_cli type ${host}:${port} ${request}

# 请求

grpc_cli call ${host}:${port} ${service}.${method} "${params}" \
--outfile=/tmp/res.bin

protoc

参见 Protocol Buffer Compiler Installation


journalctl

journalctl -n -u growing.service

资源


最后更新: September 10, 2023