# ntpdate output to text file



## vince66 (Sep 27, 2018)

Hello guys,
I would like redirect the output of ntpdate(8) into a file.
However, the command:

`ntpdate -b pool.ntp.org | tee -a filename.txt`

not fills the text file with the output I see on the screen.
How can I do ?

Thanks in advance.


----------



## SirDice (Sep 27, 2018)

Parts of the output are printed on STDERR. 

Bourne shells:
`ntpdate -b pool.ntp.org >> filename.txt 2>&1`

C shells:
`ntpdate -b pool.ntp.org >>& filename.txt`


----------

