AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题

问题[tee](ubuntu)

Martin Hope
Guntis Endzelis
Asked: 2020-08-18 20:34:50 +0800 CST

如何递归地将一行附加到所有 .gitignore 文件?

  • 2

我有一个目录,其中包含多个带有 git 存储库的子目录。我想添加desktop.ini到这些子目录中的所有.gitignore文件。

我知道我可以做到echo "desktop.ini" | tee -a .gitignore,但它不能递归地工作。

command-line text-processing tee
  • 1 个回答
  • 118 Views
Martin Hope
Ahmed Hussein
Asked: 2020-07-31 19:46:46 +0800 CST

如何在文件中同时获取 time 命令的输出?

  • 4

我运行了time echo "Hello world" | tee output.txt希望将完整输出同时发送到终端stdout和output.txt文件的命令。但是,文件内容不是我所期望的:

预期文件内容:

你好世界

实际 0m0.000s
用户 0m0.000s
系统 0m0.000s

实际内容:

你好世界”

谁能帮忙?

redirect tee
  • 1 个回答
  • 1892 Views
Martin Hope
An Ignorant Wanderer
Asked: 2020-07-20 13:49:19 +0800 CST

使用 tee 时等待上一个命令完成

  • 1

我使用tee如下:

some commands | tee -a >(command1 >> file) >(command2 >> file) >(command3 >> file)

如何将 command2 的执行延迟到 command1 结束,对于 command3 和 command2 也是如此?我试过wait这样使用,但没有用:

some commands | tee -a >(command1 >> file) >(wait command2 >> file) >(wait command3 >> file)
command-line tee
  • 1 个回答
  • 455 Views
Martin Hope
Mehmet
Asked: 2020-04-26 14:22:49 +0800 CST

三通:constraint_0_power_limit_uw:无可用数据

  • 1

我正在尝试使用新值替换 constraint_0_power_limit 文件中的值echo "45000000" | sudo tee constraint_0_power_limit_uw

该文件在/sys/class/powercap/intel-rapl/intel-rapl:0/

当我使用上面的命令时,我得到tee: constraint_0_power_limit_uw: No data available了错误。

我该如何解决这个错误?

tee echo
  • 1 个回答
  • 427 Views
Martin Hope
Mosky
Asked: 2018-11-30 08:58:50 +0800 CST

使用 tee 将日志文件保存在子文件夹中(在变量中定义)

  • 1

脚本的输入文件作为参数从命令行传递。我希望将来自 tee 的日志文件保存在与输入文件相同的目录中:

假设输入文件位于“data/temp/inputfile.txt”

这是给我带来问题的部分:

{
INPUT1=$1

#Save each subdirectory as an element of the array
bkpIFS="$IFS"
IFS='/' read -r -a inputstring <<< $INPUT1
IFS="$bkpIFS"

#Get number of levels
PATHLENGTH=${#inputstring[@]}

if [ PATHLENGTH > 1 ]
then
    #Delete the input file from path
    FILEONLY=${inputstring[-1]}
    INPUTFOLDER=${INPUT1/%$FILEONLY/}
    #Name the log file
    LOGFILE="arrays.log"
    LOGPATH="$INPUTFOLDER$LOGFILE"
else
    #If input file is at working directory
    LOGPATH="arrays.log"
fi

# Here goes the main script...

printf "\nDone!\n"

}  | tee $LOGPATH

我只是在工作目录中得到一个名为“1”的空文件。当然,如果我在最后一行写:

} | tee arrays.log

一切顺利,但我需要将每个日志文件放在与输入文件相同的位置。

log bash tee
  • 1 个回答
  • 516 Views
Martin Hope
Tono Nam
Asked: 2018-03-08 16:20:07 +0800 CST

使用“tee”命令将星号调试信息附加到文件

  • 0

当我运行时:

$ asterisk -rvvv | tee temp-log-asterisk.txt
$ ubuntu*CLI> dialplan reload
$ exit

这是星号的实际输出: 在此处输入图像描述

现在,当我查看内容时,temp-log-asterisk.txt我希望看到相同的内容,但我看到的是这个!:

在此处输入图像描述

special-characters asterisk tee
  • 1 个回答
  • 2476 Views
Martin Hope
mekkanizer
Asked: 2016-05-08 05:46:02 +0800 CST

从 alt+f2 运行 tee

  • 0

出于某种原因,这适用于术语,而不适用于“运行”对话或 Openbox 快捷方式...... echo 200 | sudo tee /sys/class/backlight/intel_backlight/brightness

tee
  • 1 个回答
  • 39 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve