当前位置:网站首页>shell跑的時候需要的需要了解命令
shell跑的時候需要的需要了解命令
2022-07-23 14:14:00 【苗苗大佬】
RUN chmod 777 /home/admin
chown -R 處理指定目錄下的文件
chmod +x 給執行加權限
在學習Linux的過程中,常會看到一些終端命令或者程序中有">/dev/null 2>&1 "出現,由於已經遇到了好幾次了,為了理解清楚,不妨花點時間百度或者google一下相關的知識。
0:錶示鍵盤輸入(stdin)
1:錶示標准輸出(stdout),系統默認是1
2:錶示錯誤輸出(stderr)
command >/dev/null 2>&1 & == command 1>/dev/null 2>&1 &
1)command:錶示shell命令或者為一個可執行程序
2)>:錶示重定向到哪裏
3)/dev/null:錶示Linux的空設備文件
4)2:錶示標准錯誤輸出
5)&1:&錶示等同於的意思,2>&1,錶示2的輸出重定向等於於1
6)&:錶示後臺執行,即這條指令執行在後臺運行
1>/dev/null:錶示標准輸出重定向到空設備文件,也就是不輸出任何信息到終端,不顯示任何信息。
2>&1:錶示標准錯誤輸出重定向等同於標准輸出,因為之前標准輸出已經重定向到了空設備文件,所以標准錯誤輸出也重定向到空設備文件。
這條命令的意思就是在後臺執行這個程序,並將錯誤輸出2重定向到標准輸出1,然後將標准輸出1全部放到/dev/null文件,也就是清空.
所以可以看出" >/dev/null 2>&1 "常用來避免shell命令或者程序等運行中有內容輸出。
修改賬號密碼
echo '' |passwd root --stdin
边栏推荐
- Google Earth engine -- a small bug in gee. Images of transcontinental boundaries cannot be obtained
- The difference between Celeron n4000 and Celeron n5095
- [wechat applet] case - local life
- Design instantiation and connection
- Golang remote server debugging
- BERT 文章翻译
- Using redis to realize distributed lock (single redis)
- 锐龙R7 PRO 6850H核显性能怎么样?相当于什么水平
- Rtx3080ti and rtx3080 gap 3080 and 3080ti parameter comparison
- How can Creo 9.0 quickly modify CAD coordinate system?
猜你喜欢

In depth analysis of common cross end technology stacks of app

Remember that a vulnhub target plane exercise successfully won the root permission

Comment creo 9.0 modifie - t - il rapidement le système de coordonnées Cao?

How about the performance of Intel Celeron 7300? What level is it equivalent to

第六天笔记

How many processors is Tianji 820 equivalent to Xiaolong? How about Tianji 1100 equivalent to Xiaolong? How about Tianji 820

英特尔赛扬7305性能怎么样?相当于什么水平级别

AppScan的安装与使用
![[wechat applet] case - local life](/img/9d/c1525ce3c199d4db83b7a3b6828b63.png)
[wechat applet] case - local life

天玑920相当于骁龙什么 天玑920相当于骁龙多少 天玑920怎么样
随机推荐
[wechat applet] case - local life
Tensor、Numpy、PIL格式转换以及图像显示
Fastadmin changes the pop-up size of the default table button
天玑720相当于骁龙多少处理器 天玑720相当于骁龙多少 天玑720怎么样
ThreadLocal 面试夺命11连问
How many processors is Tianji 820 equivalent to Xiaolong? How about Tianji 1100 equivalent to Xiaolong? How about Tianji 820
The difference between Celeron n4000 and Celeron n5095
Notes on animal farm
激励发生器、监测器
Rtx3080ti and rtx3080 gap 3080 and 3080ti parameter comparison
Day 10 notes
Spark统计每天新增用户
酷睿i7 1165g7相当于什么水平 i71165g7属于哪个档次
OSPF details (1)
How about Celeron n5095 Processor? What is the equivalent level of Intel n5095 core display
iQOO 10 Pro和小米12 Ultra哪个好 哪个值得买 两者配置对比
Using redis to realize distributed lock (single redis)
天玑1100相当于骁龙多少处理器 天玑1100相当于骁龙多少 天玑1100怎么样
How about the performance of Intel Celeron 7300? What level is it equivalent to
Canvas eraser function