转载请注明出处,原文连接http://tailnode.tk/2017/01/%E...html
scp复制多个文件,而且不须要输入yes scp -o "StrictHostKeyChecking no" 20150603.tar.gz 20150627.tar.gz 20150705.tar.gz user@host:/home/users/log/20150715/`hostname` for i in `seq -f %02g 0 23`;do file="log/pay.log.20150731"$i; echo $file;done 查看svn密码~/.subversion/auth/svn.simple/48eed6299865c0af1dac26d1a6d79efa mutt发邮件mutt -e "my_hdr content-type:text/html" -s "subject" "user@baidu.com" < mail.html 列出文件中排名前10的行及数量 sort file | uniq -c | sort -k 1 -n -r | head -10 格式化json输出`cat /tmp/json |python -m json.tool` 输出文件指定行cat filename| head -n 3000 | tail -n +1000(显示1000行到3000行),cat filename | tail -n +3000 | head -n 1000(从第3000行开始,显示1000行。即显示3000~3999行)
<!--more-->node
sed -i "s/old/new/g" `grep -rl '../../static/' *` sed批量替换多个文件的内容
编译时支持GDB调试: 1传递参数-ldflags "-s",忽略debug的打印信息 2传递-gcflags "-N -l" 参数,这样能够忽略Go内部作的一些优化,聚合变量和函数等优化,这样对于GDB调试来讲很是困难,因此在编译的时候加入这两个参数避免这些优化 3编译为静态程序CGO_ENABLED="0" go build hello.go kill -3 <pid>发送SIGQUIT信号,会将正在运行的goroutine的调用栈输出
gdb在文件上加断点时避免每次使用很长的完整路径,可以使用dir (gdb) dir /home/yourihua/workplace/rhino/src/github.com/robfig/revel/ Source directories searched: /home/yourihua/workplace/rhino/src/github.com/robfig/revel:$cdir:$cwd (gdb) b revel.go:86 Breakpoint 2 at 0x44ef60: file /home/yourihua/workplace/rhino/src/github.com/robfig/revel/revel.go, line 86. 打印vector前N个元素print *(myVector._M_impl._M_start)@N 设置调试程序的参数(gdb) set args arg1 arg2 ...
git diff 查看还没有暂存的文件更新了哪些部分 git diff filename 查看还没有暂存的某个文件更新了哪些 git diff –cached 查看已经暂存起来的文件和上次提交的版本之间的差别 git diff –cached filename 查看已经暂存起来的某个文件和上次提交的版本之间的差别 git diff ffd98b291e0caa6c33575c1ef465eae661ce40c9 b8e7b00c02b95b320f14b625663fdecf2d63e74c 查看某两个版本之间的差别 git diff ffd98b291e0caa6c33575c1ef465eae661ce40c9:filename b8e7b00c02b95b320f14b625663fdecf2d63e74c:filename 查看某两个版本的某个文件之间的差别 git log <commit-id> --stat 查看指定commit修改的哪些文件 git checkout -t origin/2.0.0 将本地分支切换为远程分支 git config --global core.excludesfile ~/.gitignore 全局忽略 git log --pretty=format:"%h - %an, %ar : %s" 输出commtid - author - commit time - commit msg git show <commitid> <file> 查看某次commit对文件的修改 git update-index --assume-unchanged your_file_path 不想继续追踪某个文件 git update-index --no-assume-unchanged your_file_path 若是想再次继续跟踪某个文件 git co -b release-2.0.1 upstream/release-2.0.1 将远程分支checkout到本地 git cherry-pick <commit-id> 将某个commit应用到当前分支
:w !sudo tee % 保存时取得sudo权限 加入行号 :'<,'>s/BIT_MASK_\zs\d*\ze/\=line(".") - line("'<") + 1,解释: '<,'> 咱们所选中的区域 (:help '<,:help '> ) s 在选中的区域中进行替换 (:help :s ) \zs 指明匹配由此开始 (:help /\zs ) \d* 查找任意位数的数字 (:help /\d ) \ze 指明匹配到此为止 (:help /\ze ) \= 指明后面是一个表达式 (:help :s\= ) line(".") 当前光标所在行的行号 (:help line() ) line("'<") 咱们所选区域中第一行的行号 (:help line() ) 当”:s”命令的替换字符串是以”\=”开头时,代表使用一个表达式计算的结果进行替换 去除重复的行 1.先排序:sort 2.而后不要同时排序:sor ur /^/
bpafter <part_url>:URL中含有part_url时中断,可修改响应而后返回给浏览器
cat <file_name> | redis-cli --pipe 一次执行多条redis命令(好比导入大量数据)
settings.json "editor.renderWhitespace":true // 显示空白字符m