how to using Linux pipe command output another command's help content to a file
how to using Linux pipe command output another command's help content to a file
Linux tee > >>

gcc help
$ gcc --help
# ???
$ gcc --help | echo > gcc-help.md
# output help to a file
$ gcc --help > gcc-help.md
> && >>
# > overwrite file
$ gcc --help > gcc-help.md
# >> append data
$ gcc --help >> gcc-help.md
total 10 ways
|| visible in terminal || visible in file || existing
Syntax || StdOut | StdErr || StdOut | StdErr || file
==========++==========+==========++==========+==========++===========
> || no | yes || yes | no || overwrite
>> || no | yes || yes | no || append
|| | || | ||
2> || yes | no || no | yes || overwrite
2>> || yes | no || no | yes || append
|| | || | ||
&> || no | no || yes | yes || overwrite
&>> || no | no || yes | yes || append
|| | || | ||
| tee || yes | yes || yes | no || overwrite
| tee -a || yes | yes || yes | no || append
|| | || | ||
n.e. (*) || yes | yes || no | yes || overwrite
n.e. (*) || yes | yes || no | yes || append
|| | || | ||
|& tee || yes | yes || yes | yes || overwrite
|& tee -a || yes | yes || yes | yes || append
tee
# output help to a file
$ gcc --help | tee gcc-help.txt
# > overwrite file
$ gcc --help > gcc-help.txt
# >> append data
$ gcc --help >> gcc-help.txt
refs
https://askubuntu.com/questions/420981/how-do-i-save-terminal-output-to-a-file
https://en.wikipedia.org/wiki/Standard_streams#Standard_error_.28stderr.29
https://askubuntu.com/questions/38126/how-to-redirect-output-to-screen-as-well-as-a-file
xgqfrms 2012-2020
www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!
how to using Linux pipe command output another command's help content to a file的更多相关文章
- 【Linux】-NO.8.Linux.4.Command.1.001-【Common Command】-
1.0.0 Summary Tittle:[Linux]-NO.8.Linux.4.Command.1.001-[Common Command]- Style:Linux Series:Command ...
- Linux pipe 源代码分析
Linux pipe 源代码分析 管道pipe作为Unix中历史最悠久的IPC机制,存在各个版本号的Unix中,主要用于父子进程之间的通信(使用fork,从而子进程会获得父进程的打开文件表) ...
- centos 7.3 安装 mysqldb 报错 EnvironmentError: mysql_config not found ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Command errored : command: /usr/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] ...
- 解决xcode10打包报错:That command depends on command in Target ‘xxx’:scrpit phase"[CP] Copy Pods Resources"
问题:使用xcode10打包报错,提示 error:Multiple commands produce ‘xxxx/xxx.app’ 1)Target ‘xx’ has create director ...
- Linux后台运行命令 nohup command > myout.file 2>&1
Linux命令后台运行 转自北国的雨,谢谢:http://www.cnblogs.com/lwm-1988/archive/2011/08/20/2147299.html 有两种方式:1. comma ...
- 解决linux mysql命令 bash: mysql: command not found 的方法
错误: root@DB-02 ~]# mysql -u root-bash: mysql: command not found 原因:这是由于系统默认会查找/usr/bin下的命令,如果这个命令不在这 ...
- Linux 中,基础命令 command not found...问题
linux中出现基本命令找不到的问题,经过查找发现是/etc/profile文件出现了问题,解决方案如下: 问题详细: [root@master ~]# ll bash: ls: command no ...
- Linux下编译提示arm-none-linux-gnueabi-gcc: command not found
自己的Linux系统中已经正确安装了交叉编译器arm-2009q3,路径设置正常. 但是在使用arm-none-linux-gnueabi-gcc编译时提示 arm-none-linux-gnuea ...
- linux下安装pm2,pm2: command not found
1:安装pm2 操作描述: 你要在linux上安装pm2有很多方法,但我是用node的工具npm来完成安装的,所以在安装pm2之前需要先安装node.这里如果不会,就百度一个安装node,这个小事我就 ...
随机推荐
- Bitter.Core系列七:Bitter ORM NETCORE ORM 全网最粗暴简单易用高性能的 NETCore ORM 示例 更新删除插入
Bitter Orm 在操作数据库增删改的时候,支持模型驱动和直接执行裸SQL 操作,示例代码如下: 一:模型驱动(增删改) /// <summary> /// 插入,删除,更新示例(模型 ...
- CPU飙高,系统性能问题如何排查?
CPU飙高,系统性能问题如何排查? 原创 雍雍 阿里技术 2020-09-29 https://mp.weixin.qq.com/s/fzLcAkYwKhj-9hgoVkTzaw
- (转载)微软数据挖掘算法:Microsoft 时序算法之结果预测及其彩票预测(6)
前言 本篇我们将总结的算法为Microsoft时序算法的结果预测值,是上一篇文章微软数据挖掘算法:Microsoft 时序算法(5)的一个总结,上一篇我们已经基于微软案例数据库的销售历史信息表,利用M ...
- 从epoll构建muduo-1 mini-muduo介绍
https://blog.csdn.net/voidccc/article/details/8719752 ========== https://blog.csdn.net/liangzhao_jay ...
- 长连接 短连接 RST报文
https://baike.baidu.com/item/短连接 短连接(short connnection)是相对于长连接而言的概念,指的是在数据传送过程中,只在需要发送数据时,才去建立一个连接,数 ...
- Java中运行javascript代码
Java中运行javascript代码 1.Java 代码 2.JS代码 2.1demoWithParams.js 2.2demoWithListParams.js 原文作者:russle 原文地址: ...
- postfix “ Sender address rejected: not logged in”
一.问题 先说一下问题,我们公司有两台邮件服务器,分别是不同的域名但是用的是同一个用户认证,最近老有人反应说,有匿名邮件就是通过类似这种网站,进行使用你们公司的SMTP邮件服务器进行发送垃圾邮件 ...
- REST架构及其介绍
概述 REST是英文Representational State Transfer的缩写,中文翻译:表述性状态转移. 他是由Roy Thomas Fielding博士在他的论文 < ...
- 31.FTP简介
1.FTP 是一种在互联网中进行文件传输的协议,基于客户端/服务器模式,默认使用20.21号端口,其中端口20(数据端口)用于进行数据传输,端口21(命令端口)用于接受客户端发出的相关FTP 命令与参 ...
- 25.sshd和scp
1.配置sshd服务 想要使用 SSH 协议来远程管理Linux 系统,则需要部署配置sshd 服务程序.sshd 是基于SSH协议开发的一款远程管理服务程序. sshd 服务的配置信息保存在/e ...