博客
分类
标签
归档
随笔
日报
博客
分类
标签
归档
随笔
日报
linux启动docker服务
安装和启动这个写很好:Install Docker Engine on Ubuntu 在上述教程install之后docker run hello-word之前可能需要启动docker后台服务:sudo service docker starthow would you know that the service name was docker: You can see them using...
2022-09-01
tool
linux
tool
linux
Read More
bash获取命令退出代码
echo $?即输出上一条执行命令的退出码另外if command; then fi也是对command的退出码进行判断,如果为0则条件成立
2022-09-01
tool
linux
tool
linux
Read More
bash超时kill
timeout 3 sleep 30 当 sleep 执行 3 秒的时候就会终止 包裹程序未超时,timeout传递退出代码(--preserve-status)(亲测似乎不加此选项也会保护退出代码) timeout --preserve-status 1m ping -c 5 Nostromo.local echo $? # 如果timeout包裹的程序超时,则返回值为124,否则为未超...
2022-09-01
tool
linux
tool
linux
Read More
bash遍历数组
无下标控制,类似range-for array=(hello word) for element in $array do echo $element done 下标:`$
2022-09-01
tool
linux
tool
linux
Read More
bash变量计数加一
i=1 # in loop body i=`expr $i + 1`
2022-09-01
tool
linux
tool
linux
Read More
bash获取命令输出内容 一维或多维
一维 line=`cat syntest.sh | wc -l` echo $line 多维:返回数组 fnames=`ls testcase/functional | grep .sy` for fname in ${fnames[@]} do echo $fname done
2022-09-01
tool
linux
tool
linux
Read More
bash条件判断命令执行返回值
if diff test.sh syntest.sh > tmpout; then # diff比较如果相同则返回0,则会if条件成立走上面的分支 echo "same." else echo "different." fi rm -rf tmpout
2022-09-01
tool
linux
tool
linux
Read More
lsof 查看资源被进程占用情况
打开文件的进程定位到打开的进程 lsof <file> $ lsof /opt/mysql/data/5690/mysql-error.log COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME mysqld 12858 actiontech-universe 1w ...
2022-08-16
debug
tool
linux
tool
linux
debug
Read More
有sudo的ubuntu安装指定版本gcc
https://blog.csdn.net/qq_29007291/article/details/84953671
2022-08-11
fix_error
tool
linux
tool
linux
fix_error
Read More
linux服务器间文件传送 .tar.gz文件压缩和解压
旧服务器备份:把~/.halo压缩 tar -zvcf ~/.halo.tar.gz ~/.halo # 得到~/.halo.tar.gz 移到新服务器中在旧服务器上运行 scp ~/.halo.tar.gz <新服务器用户名>@<新服务器ip地址>:~/.halo.tar.gz #scp即secure copy,是用来进行远程文件拷贝的。数据传输...
2022-08-11
tool
linux
tool
linux
Read More
Previous
4 / 6
Next
粘贴文本
全选文本
剪切文本
复制文本
站内搜索
必应搜索
新标签页打开
复制链接地址
复制图片
谷歌识图
常见问题
示例博客
加入社区
本站源码
主题源码
暗黑模式
打印页面
阅读模式