• 请不要在回答技术问题时复制粘贴 AI 生成的内容
darasion
V2EX  ›  程序员

shell 的输出,如何排版?怎样使不同行的相应列对齐?

  •  
  •   darasion · May 23, 2012 · 14630 views
    This topic created in 5277 days ago, the information mentioned may be changed or developed.
    怎样使不同行的相应列对齐?有什么技巧吗?

    对齐的例子:
    a b c
    1 2 3

    没对齐的例子:
    a b c
    1 222222222222222222222 3
    4 replies  •  1970-01-01 08:00:00 +08:00
    tioover
    tioover
    May 23, 2012
    1
    Printf()有相应的参数的
    cfddream
    cfddream
    May 23, 2012
    2
    \t
    echo -en 'sd \tjflds\nsfdf \tfdsfds\n'
    9hills
    9hills
    May 23, 2012
    3
    分隔符用\t(制表符)而不是空格
    gDD
    gDD
    May 23, 2012❤️2
    4
    mount | column -t

    man column
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   4989 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 41ms · UTC 05:58 · PVG 13:58 · LAX 21:58 · JFK 00:58
    ♥ Do have faith in what you're doing.