flatpak
将输出打印为表格:
$ flatpak search firefox
Name Description Application ID Version Branch Remotes
Firefox Fast, Private & Safe Web Browser org.mozilla.firefox 116.0.2 stable flathub
Mullvad B… Free the internet from mass surveillance …ullvad.MullvadBrowser 12.5.2 stable flathub
Mojave-GTK Mojave-Style Theme for GTK Flatpak Applications …tk3theme.Mojave-light 0.1 3.22 flathub
但是,如果它通过管道传输到某些内容,例如cat
or grep
,则输出不再格式化为表,并且表头消失:
$ flatpak search firefox | cat
Firefox Fast, Private & Safe Web Browser org.mozilla.firefox 116.0.2 stable flathub
Mullvad Browser Free the internet from mass surveillance net.mullvad.MullvadBrowser 12.5.2 stableflathub
Mojave-GTK Mojave-Style Theme for GTK Flatpak Applications org.gtk.Gtk3theme.Mojave-light 0.1 3.22 flathub
即使输出通过管道传输到另一个进程,如何强制 flatpak 将输出格式化为表格?