I would like to make tee catch the stderr and log it into a file. A brute force method by let tee listen on both stderr and stdout is okay like cmd 2>&1 | tee -a log But how to make tee catch the stderr only? You can make use of “process substitution” (>(…)) to
Read more
Tag: STDOUT
In Golang, how to print string to STDERR?
Posted onIn Golang, the fmt.Println() is convenient to print to STDOUT. But how to print string to STDERR? In Go os package, “Stdin, Stdout, and Stderr are open Files pointing to the standard input, standard output, and standard error file descriptors.” So, you can use the WriteString function on File on os.Stderr to print string to
Read more
Printing “powernow-k8 transition frequency failed” after install XEN
Posted onAfter I installed XEN hypervisor, the tty0 (CTRL+ALT+F1) prints “powernow-k8 transition frequency failed” to STDOUT continously, how to solve it? sudo rmmod powernow_k8 From https://lists.debian.org/debian-user/2013/01/msg00754.html How to make the settings persistent (take effect after reboot)? 1, Create script file ‘/etc/init.d/stop_pwoerk8.sh’ as follows. harry2vera@node1:/etc/init.d$ cat stop_pwoerk8.sh #! /bin/sh rmmod powernow_k8 2, Add the full PATH of
Read more
Required packages for building YouCompleteMe for Vim on Fedora 21
Posted onYouCompleteMe for Vim on Fedora 21 reports this error: [zma@laptop:~/.vim/bundle/YouCompleteMe]$ ./install.sh — The C compiler identification is GNU 4.9.2 — The CXX compiler identification is GNU 4.9.2 — Check for working C compiler: /usr/bin/cc — Check for working C compiler: /usr/bin/cc — works — Detecting C compiler ABI info — Detecting C compiler ABI info
Read more
How to redirect STDOUT of sudo command on Linux and write to file as root?
Posted onA try like the following command failed $ sudo echo “echo hello” > /usr/local/bin/hello with an message bash: /usr/local/bin/hello: Permission denied It seems the writing to the file is executed under the non-root user. How to redirect STDOUT of sudo command on Linux and write the content to the file (/usr/local/bin/hello here) as root? You
Read more
How to disable the email notification by crond?
Posted oncrond sends email notifications automatically. However, these emails are not needed. How to disabled it? If your command does not anything printed to STDOUT or STDERR, there is not emails send. You can redirect 2 and 1 to /dev/null at the end of your command. You can also set the MAILTO variable to empty by
Read more
How to convert HTML file to text on Linux
Posted onHow to convert HTML file to a text on Linux? You can use html2text (can be installed on Fedora by yum install html2text): $ html2text ${html_file} ${html_file} is the html file to be converted. The converted text will be printed to the STDOUT. You can redirect it to a file if it is needed. Adding
Read more
Latex Cheat Sheet
Posted onLatest has many commands and it is not easy to quickly remember them all. Then, a cheat sheet will be very useful. Here is a collection of cheat sheets for Latex that I collected from the Web. Latex cheat sheet Latex cheat sheet by Winston Chang: Download latex cheat sheet. LaTeX Math Symbols https://web.archive.org/web/20190707092927/http://web.ift.uib.no/Teori/KURS/WRK/TeX/symALL.html
Makefile Tutorials
Posted onMake is a utility that automatically builds executable programs and libraries from source code by reading files called makefiles which specify how to derive the target program. Make is widely used, especially in Unix/Linux world. More introductions to Make and it’s history can be found on Wikipedia. In this post, I list articles for Makefile
Read more
pkill and pgrep: Process Management Commands
Posted onThis is a introduction to *nix’s process management tools: pkill and pgrep. As this site’s domain name was pkill.info, a introduction to pkill should exist here. NAME pgrep, pkill – look up or signal processes based on name and other attributes SYNOPSIS pgrep [-flvx] [-d delimiter] [-n|-o] [-P ppid,…] [-g pgrp,…] [-s sid,…] [-u euid,…]
Read more