当前位置:网站首页>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
边栏推荐
- Why can't V-IF and V-for be used together
- d. TS --- for more detailed knowledge, please refer to the introduction on the official website (chapter of declaration document)
- CPT 104_TTL 09
- Cross domain CORS relationship~
- Create a tabbar component under the components folder, which is public
- Data bus realizes the communication between brother components
- C# ,类库
- es6数组的使用
- WTL self drawn control library (cqscheckcomboxbox)
- If the route reports an error after deployment according to the framework project
猜你喜欢

Camera imaging + homography transformation + camera calibration + stereo correction

After adding qmenu to qtoolbutton and QPushButton, remove the triangle icon in the lower right corner

弘玑微课堂 | Cyclone RPA之“灵活的数字员工”执行器

The title bar will be pushed to coincide with the status bar

C test calls the paddlesharp module to recognize pictures and words
Redis的基本知识

Nécessité de précharger les cookies dans le sélénium

Domain driven model DDD (III) -- using saga to manage transactions

Cross platform packaging of QT packaging program

!!!!!!!!!!!!!!!!!!
随机推荐
catkin_ What did package do
Multiple mainstream SQL queries only take the latest one of the data
SQL Server检索SQL和用户信息的需求
[no title] Click the classification jump page to display the details
CORS and proxy (づ  ̄ 3  ̄) in egg ~ the process of stepping on the pit and filling the pit ~ tot~
Hongji | how does HR carry out self change and organizational change in the digital era?
使用宝塔+xdebug+vscode远程调试代码
CPT 104_TTL 09
On the use of constant pointer and pointer constant -- exercise (record)
2021-10-08
selenium預先加載cookie的必要性
Error handling mechanism of the strongest egg framework in history
qt. qpa. plugin: Could not find the Qt platform plugin “xcb“ in ““
How to set the initial value of El input number to null
Fast application fuzzy search
Understand the relationship between promise async await
Domain driven model DDD (III) -- using saga to manage transactions
Output string in reverse order
跨域CORS的情缘~
uni使用的一些坑