用户工具

站点工具


程序设计:bash:man2txt

man 转换成 txt 文本文件

man 命令 | col -b > file.txt

我们可以写一个脚本

#/bin/sh
if [ -z "$1" ]; then
    echo 
    echo man2txt command
    echo 
    else
        if [ -e "$1" ]; then 
            man -l $1 | col -b > $1.txt
            else
                man $1 | col -b > $1.txt
        fi
fi

保存为 man2txt 就可以了

程序设计/bash/man2txt.txt · 最后更改: 2023/06/13 05:25 由 127.0.0.1