Posted on:
Last modified:
最近工作中经常用到的一些组合命令,本来想提交到 commandlinefu.com 上,但是忘记了密码,怎么也登录不上去了,记到这里吧
dirname $0
du -sh * | sort -rh
cd -
tail *
set -x # 显示每个执行的命令
set -e # 当有程序返回非 0 值时直接退出,相当于抛出异常
cat << EOF > /tmp/yourfilehere
These contents will be written to the file.
This line is indented.
EOF
fd -t f -0 | xargs -0 sed -i /KeyWord/d
Always quote strings in bash. If you string is empty and you are testing it with == or !=, then there will be a "== is not uniary operator" error
fd . -t file -0 | xargs -0 sed -i -e "s/make_redis_client/create_redis_client/g"
© 2016-2022 Yifei Kong. Powered by ynotes
All contents are under the CC-BY-NC-SA license, if not otherwise specified.
Opinions expressed here are solely my own and do not express the views or opinions of my employer.