当前位置:网站首页>shell指令学习1
shell指令学习1
2022-04-23 05:30:00 【mg1507】
1、 shell的作用
- 自动化批量系统初始化程序(update,软件安装,时区设置,安全策略…);
- 自动化批量软件部署程序;(LAMP/LNMP/Tomcat/LVS/Nginx);
- 管理应用程序(KVM、集群管理扩容、MySQL);
- 日志分析处理程序(PV、UV、200、!200、grep/awk);
- 自动化备份恢复程序(MySQL完全备份/增量+Crond)…
2、echo $?
输出返回值,如果正确则是0,非0代表错误。
3、命令1 && 命令2 &&具备逻辑判断,当命令1执行成功则执行命令2。
4、命令1 || 命令2 当命令1执行失败,则命令2执行。
5、&>
重定向混合输出,包括标准输出和错误输出。
# 将无用的信息输出到/dev/null
&> /dev/null
6、sh脚本,bash xxx.sh执行 sh xxx.sh也可以执行。
7、如果通过路径来执行,需要加权限 chmod +x xxx.sh。
8、shell脚本开头一般写上:#!/usr/bin/bash
其作用是:定义程序用哪个解释器执行。
9、合并两个文件 cat xx1 >> xx2
,>
将正常信息重定向,重定向是覆盖原始的文件,>>
则是追加。
10、&
表示任务在后台执行。
版权声明
本文为[mg1507]所创,转载请带上原文链接,感谢
https://blog.csdn.net/mg1507/article/details/111222593
边栏推荐
- Escape characters \ splicing of data formats
- 点击添加按钮--出现一个框框(类似于添加学习经历-本科-研究生)
- C# ,类库
- The QT debug version runs normally and the release version runs crash
- uni使用的一些坑
- QSS, qdateedit, qcalendarwidget custom settings
- 日志简介和构建web应用
- Use of qwbengneview and qwebchannel.
- Laravel routing settings
- Some pits used by uni
猜你喜欢
Generation of straightening body in 3D slicer
QT displays the specified position and size of the picture
Uniapp wechat sharing
Uncle wolf is looking for a translator -- Plato -- ongoing translation
Laravel implements the Holy Grail model with template inheritance
2021-11-01
es6数组的使用
双击.jar包无法运行解决方法
[triangle Yang Hui triangle printing odd even cycle JS for break cycle]
弘玑|数字化时代下,HR如何进行自我变革和组织变革?
随机推荐
On the use of constant pointer and pointer constant -- exercise (record)
Graphics. Fromimage reports an error "graphics object cannot be created from an image that has an indexed pixel..."
Parsing of string class intern() method
Redis in node -- ioredis
what is wifi6?
CORS and proxy (づ  ̄ 3  ̄) in egg ~ the process of stepping on the pit and filling the pit ~ tot~
2021-09-27
Quick app bottom navigation bar
Box collapse and margin collapse
The prefix of static of egg can be modified, including boots
TSlint注释忽略错误和RESTful理解
2021-09-28
How to realize adaptive layout
Phlli in a VM node
Laravel implements the Holy Grail model with template inheritance
Basic knowledge of redis
Nécessité de précharger les cookies dans le sélénium
弘玑微课堂 | Cyclone RPA之“灵活的数字员工”执行器
C test calls the paddlesharp module to recognize pictures and words
Create cells through JS (while loop)