3

Seems like this should be a pretty simple one, but I can't figure it out (obviously).

When I open a terminal window and run, for example, the command man ffmpeg, the output I see within the terminal looks like this:

FFMPEG(1)                                                            FFMPEG(1)

NAME
       ffmpeg - ffmpeg video converter

SYNOPSIS
       ffmpeg [global_options] {[input_file_options] -i input_file} ...
       {[output_file_options] output_file} ...

DESCRIPTION
       ffmpeg is a very fast video and audio converter that can also grab from
       a live audio/video source. It can also convert between arbitrary sample
       rates and resize video on the fly with a high quality polyphase filter.

... which is how I would expect it to look. However, when I try to dump that info into a text file using the command man ffmpeg > man_ffmpeg.txt the results I get look like this:

FFMPEG(1)                                                            FFMPEG(1)



NNAAMMEE
       ffmpeg - ffmpeg video converter

SSYYNNOOPPSSIISS
       ffmpeg [_g_l_o_b_a_l___o_p_t_i_o_n_s] {[_i_n_p_u_t___f_i_l_e___o_p_t_i_o_n_s] -i _i_n_p_u_t___f_i_l_e} ...
       {[_o_u_t_p_u_t___f_i_l_e___o_p_t_i_o_n_s] _o_u_t_p_u_t___f_i_l_e} ...

DDEESSCCRRIIPPTTIIOONN
       ffmpeg is a very fast video and audio converter that can also grab from
       a live audio/video source. It can also convert between arbitrary sample
       rates and resize video on the fly with a high quality polyphase filter.

All I want to do is have what I would normally see inside the terminal dumped into a text file, but obviously I'm doing something wrong. What's the best way to do this?

4

1 回答 1

5

man输出有很多隐藏的退格字符。您看到的所有额外字符SBS字符都是特殊字符。以下命令将清除这些:

man ffmpeg | col -b > man_ffmpeg.txt

现在您可以获得清晰的纯文本输出。

资源:

男人男人

...

要获取手册页的纯文本版本,没有退格和下划线,请尝试

# 人富 | col -b > foo.mantxt

编辑:小澄清

于 2013-06-16T19:47:39.020 回答