Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Originally I used pacman, not pacman-color and I copied the output into a file and I displayed the output in the terminal with the following command :

pacman -Syu | tee file.log

Unfortunately, it seems that pacman-color detects that the output is sent to a pipe and it deactives the colored output.
So my question is how to force pacman-color to display a colored output even if the output is sent to a pipe? As with yaourt :

yaourt -Syu --color | tee file.log

Or maybe there is a way to do it without using pipe or tee?

share|improve this question
up vote 2 down vote accepted

Try this

script -c 'pacman-color -Syu' file.log

Idea taken from here.

share|improve this answer
Wow awesome it works !!! I had already read the question you linked but I hadn't understand the power of 'script'. And with the '-q' option is usefull to only print the command output. – Nicolas Jan 21 '13 at 12:01

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.