shell脚本 在后台执行de 命令 >> 文件 2>&1 将标准输出与错误输出共同写入到文件中(追加到原有内容的后面)
命令 >> 文件 2>&1 或 命令 &>> 文件 |
将标准输出与错误输出共同写入到文件中(追加到原有内容的后面) |
# ll >>aaa 2>&1
root@test-W330-C30:~# cat aaa
总用量 3248
drwx------ 18 root root 4096 5月 18 19:35 ./
drwxr-xr-x 36 root root 4096 5月 18 14:41 ../
-rw-r--r-- 1 root root 49 5月 18 19:35 1
drwxr-xr-x 3 root root 4096 3月 22 15:52 3d-haiguang-zhaoxim/
-rw-r--r-- 1 root root 190 3月 22 15:58 3d-haiguang-zhaoxim.zip
drwxr-xr-x 2 root root 4096 5月 4 20:12 aa/
-rw-r--r-- 1 root root 0 5月 18 19:35 aaa
-rw-r--r-- 1 root root 50 3月 31 10:44 .applet
-rw------- 1 root root 23741 5月 18 13:12 .bash_history
-rw-r--r-- 1 root root 3106 10月 23 2015 .bashrc
drwxr-xr-x 2 root root 4096 5月 4 20:12 bb/
drwx------ 6 root root 4096 3月 31 10:44 .cache/
drwxr-xr-x 2 root root 4096 5月 4 20:12 cc/
drwx------ 11 root root 4096 3月 20 19:46 .config/
drwx------ 3 root root 4096 3月 20 19:43 .dbus/
drwxr-xr-x 2 root root 4096 3月 31 10:44 Desktop/
-rw-r--r-- 1 root root 15482 3月 20 19:46 .face
drwx------ 3 root root 4096 3月 20 22:27 .gnupg/
-rw-r--r-- 1 root root 132 3月 20 19:45 history
-rw------- 1 root root 1388 3月 31 10:43 .ICEauthority
-rw-r--r-- 1 root root 0 3月 31 10:43 .instance_kds.lock
-rw-r--r-- 1 root root 3146783 4月 10 09:28 klbios-4.1.4-KL2003251-test-A1927-nologo.fd
-rw------- 1 root root 36 5月 7 16:55 .lesshst
drwx------ 3 root root 4096 3月 20 19:46 .local/
drwx------ 4 root root 4096 3月 31 10:44 .mozilla/
drwx------ 2 root root 4096 3月 20 19:46 .presage/
-rw-r--r-- 1 root root 189 3月 13 22:09 .profile
-rw-r--r-- 1 root root 81 3月 31 10:46 .recentAppLog
-rw------- 1 root root 1024 3月 13 21:58 .rnd
drwxr-xr-x 2 root root 4096 3月 20 19:46 .sogouinput/
drwx------ 2 root root 4096 5月 15 12:35 .ssh/
-rw------- 1 root root 12409 5月 18 13:09 .viminfo
drwxr-xr-x 2 root root 4096 3月 31 10:43 .vnc/
-rw------- 1 root root 967 5月 18 19:35 .Xauthority
drwxr-xr-x 2 root root 4096 3月 20 19:46 桌面/
root@test-W330-C30:~# ll >>aaa 2>&1
shell脚本 在后台执行de 命令 >> 文件 2>&1 将标准输出与错误输出共同写入到文件中(追加到原有内容的后面)的更多相关文章
- 将make的输出(标准输出/标准错误输出)重定向到文件
方式 描述符 含义 stdin 0 标准输入 stdout 1 标准输出 stderr 2 标准错误输出 1.想要把make输出的全部信息,输出到某个文件中 最常见的办法就是:make xxx > ...
- shell脚本介绍 shell脚本结构和执行 date命令用法 shell脚本中的变量
- shell脚本介绍、shell脚本结构和执行、date命令用法、shell脚本中的变量
7月11日任务 20.1 shell脚本介绍20.2 shell脚本结构和执行20.3 date命令用法20.4 shell脚本中的变量 20.1 shell脚本介绍 1.shell脚本语言是linu ...
- Linux centosVMware shell脚本介绍、shell脚本结构和执行、date命令用法、shell脚本中的变量
一. shell脚本介绍 shell是一种脚本语言 aming_linux blog.lishiming.net 可以使用逻辑判断.循环等语法 可以自定义函数 shell是系统命令的集合 shell脚 ...
- Linux Shell脚本入门--wget 命令用法详解
Linux Shell脚本入门--wget 命令用法详解 wget是在Linux下开发的开放源代码的软件,作者是Hrvoje Niksic,后来被移植到包括Windows在内的各个平台上.它有以下功能 ...
- shell脚本编写步骤及其常用命令和符号
1,什么是Shell Shell 是kernel的一个外壳,是一个命令解析器,负责用户与内核的交互.2,Shell脚本 Shell脚本类似于批处理,可以方便的执行大量命令.3,编写sh ...
- jenkins 登录远程机器并执行脚本,脚本中有后台执行的程序无法执行解决方法。
jenkins构建shell执行配置 在远程shell脚本中,需要后台执行的命令需要以$( )括起来
- 让shell脚本在后台飞
1. 使用&符号在后台执行命令 你可以在Linux命令或者脚本后面增加&符号,从而使命令或脚本在后台执行,例如:. $ ./my-shell-script.sh & 2. 使用 ...
- Linux Shell脚本入门--cut命令
Linux Shell脚本入门--cut命令 cut cut 命令可以从一个文本文件或者文本流中提取文本列. cut语法 [root@www ~]# cut -d'分隔字符' -f fields &l ...
随机推荐
- Istio 网络弹性 实践 之 故障注入 和 调用重试
网络弹性介绍 网络弹性也称为运维弹性,是指网络在遇到灾难事件时快速恢复和继续运行的能力.灾难事件的范畴很广泛,比如长时间停电.网络设备故障.恶意入侵等. 重试(attempts) Istio 重试机制 ...
- css 怎么在文字两边加上横线
<div class="title"> <h2 class="title-text"><span>工作经历</span ...
- jd的艺术
我看最近的狗东的ldz很火哈.所以我也来凑个热闹发个教程. 准备工作 1.一台openwrt系统设备 2.一个脑子 3.一双手 话不多说,开始吧! 步骤 一.链接N1(你的设备) 这里需要一款ssh工 ...
- 【论文笔记】Learning Fashion Compatibility with Bidirectional LSTMs
论文:<Learning Fashion Compatibility with Bidirectional LSTMs> 论文地址:https://arxiv.org/abs/1707.0 ...
- XSS-change通关历程
Level1:没有过滤. <script>alert(1)</script> <svg/onload=alert(1)> <script>confirm ...
- kubectl 缩写和别名
Use "kubectl explain " for a detailed description of that resource (e.g. kubectl explain p ...
- python3使用迭代生成器yield减少内存占用
技术背景 在python编码中for循环处理任务时,会将所有的待遍历参量加载到内存中.其实这本没有必要,因为这些参量很有可能是一次性使用的,甚至很多场景下这些参量是不需要同时存储在内存中的,这时候就会 ...
- JavaScript动态设置div的样式的方法
有时候需要根据需要动态设置div的样式,当然对于稍有经验的javascript开发者来说,这一切都是那么的简单,但是对于初学者或者说没有相关经验的开发者来说可能就是一个不大不小的难关,下面就通过实例简 ...
- c/c++ 指针数组 和 数组指针
看这个标题都要晕了,我们不妨把他拆开来理解,比较容易 指针数组:对象是一个数组,数组元素的类型是指针 指针数组的定义方式: 类型名 *数组名[数组长度]; 如: int *p[8]; 数组指针:对象是 ...
- php 获取某年后的日期
比如两年后:date('Y-m-d',strtotime('+2 year')) 月份year改成month