Skip to content

Instantly share code, notes, and snippets.

@zyfyy
Last active April 22, 2022 14:02
Show Gist options
  • Save zyfyy/716c424fe14ec908aadeaa6f8cce5771 to your computer and use it in GitHub Desktop.
Save zyfyy/716c424fe14ec908aadeaa6f8cce5771 to your computer and use it in GitHub Desktop.
[command] 各类有用的命令 #curl #command

skip local file use rsync --ignore-existing-files to skip local existing files

# Sed类常用操作
sed -e 's/foo/bar/' myfile
sed -e 's/foo/bar/g' myfile
sed -i '' 's/foo/bar/g' myfile
sed -i '' 's/foo/bar/g' ./m*
sed -i '' 's/foo/bar/g' `grep foo -rl --include="m*" ./`
## \\用来指定行首位置
sed '/^ *memory: 2Gi/a \\ ephemeral-storage: 4Gi'
## sed删除匹配行
sed -i '/^a.*/d' temp.txt
## mac use gsed instead of sed
## 删除指定匹配行
gsed -i '1{/^ *$/d}' *.mdx
# 将多个本地文件通过上传接口上传至服务器
curl -v -k -F file=@main.go https://zyfyus.tpddns.cn:8888/uploader
wget -r -p -np -k -nc --limit -rate=1024k
# -nc 断点续传
# -np 不查找上游路径
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment