Linked Questions

27 votes
1 answer
10k views

Test environment: $ mkdir testdir $ cd testdir $ echo | tee "file name" Now, ls will print file?name (under Ubuntu GNU bash, at least), while ls | cat will print file and name in separate lines. ...
hyde's user avatar
  • 1,318
2 votes
1 answer
2k views

My Linux server is running SystemD (RHEL/CentOS/Debian/Ubuntu...). I would like to redirect the output of systemctl list-dependencies to a file, but I want to preserve the ANSI colors (red or green ...
Franklin Piat's user avatar
4 votes
0 answers
745 views

I am using journalctl to watch the system by journalctl -f -p 4, but I'd like to grep-out some information. This works: journalctl -f -p 4|grep -v "maximal mount", but grep discards any color info, a ...
alessandro's user avatar
1 vote
0 answers
419 views

echo -e "SUCCESS=$(tput setaf 1)$(tput setab 7)FALSE$(tput sgr 0) Share=$DIR1 \ LastCheckedDate=$(date +%Y_%m_%d_%H:%M:%S)" >> $ERROR_LOG In error log I am ...
venella's user avatar
  • 25
1 vote
1 answer
183 views

I want to convert all output to the terminal that a certain command generates, using some filter program. How can I achieve this? The immediate answer might be, “Use a pipeline”. However, too many ...
Wolfgang Jeltsch's user avatar
1 vote
0 answers
79 views

EDIT: specifically what worked for me was using the python script in this answer and I gave the tweaks I used to get it working for my autoloading functions in fishshell, and on ubuntu 20.04, in this ...
Owen_AR's user avatar
  • 186
0 votes
0 answers
30 views

A question at stackoverflow has answers that show the following way of detecting if standard output is a pipe: if [ -t 1 ] ; then echo terminal; else echo "not a terminal"; fi The -t flag ...
glibg10b's user avatar
  • 428
36 votes
4 answers
20k views

I am running Ubuntu 10.04 and I use upstart for daemon management. My enterprise application is run as a daemon and must be run as root because of various privileges. E.g.: sudo start my-...
amphibient's user avatar
  • 12.8k
22 votes
3 answers
5k views

Given this minimal example ( echo "LINE 1" ; sleep 1 ; echo "LINE 2" ; ) it outputs LINE 1 and then, after one second, outputs LINE 2, as expected. If we pipe this to grep LINE ( echo "LINE 1" ; ...
lisyarus's user avatar
  • 323
21 votes
3 answers
3k views

When I execute a command from a terminal that prints coloured output (such as ls or gcc), the coloured output is printed. From my understanding, the process is actually outputting ANSI escape codes, ...
Chris Smith's user avatar
15 votes
1 answer
16k views

I have a custom service and have explicitly called for all stdout & stderr to be sent to syslog in the config file, however only some of the output appears in both syslog and the journal (they are ...
fileinsert's user avatar
5 votes
3 answers
3k views

I have a perl program that prints to stdout, which I then pipe into a file, like this: ./skript.pl > file.txt 2>&1 This makes the output of that skript buffer. However, I would like to be ...
fifaltra's user avatar
  • 695
5 votes
2 answers
3k views

Is there a way to let the terminal show the raw escape sequence? (e.g. those used to control color) I came across this UNIX.SE question, and want to filter "red" output ( Filter output of command by ...
tinlyx's user avatar
  • 1,086
2 votes
2 answers
6k views

Let's say I want to see the output what a command does, such as apt-get. However, if I would run a command redirecting the output such as apt-get install some-application -y > apt_out.txt or apt-...
Guillaume Chevalier's user avatar
3 votes
2 answers
3k views

I wrote a program (in Ruby) and it worked well. It prints out a few lines of text and then pause for a minute and then repeats the above. It works well (in Mac OS X's terminal), but I noted that if I ...
nonopolarity's user avatar
  • 3,319

15 30 50 per page