Have you ever used the "column" command?
tinkerbetter.tube/videos/watch/735e9783-3424-4e…
Yes, there’s other tools that can make terminal output prettier on Linux. We all know that. But the “column” command is likely already there, on your system, waiting for you to use it.
With “column” you can get nice looking terminal output & JSON from terminal commands, without a lot of additional cruft!
I mentioned a few print materials in this episode, here’s some links:
📖 The AWK book: https://archive.org/details/pdfy-MgN0H1joIoDVoIC7
📘 The K/P UNIX book: https://archive.org/details/unixprogramminge0000kern
🔐 1979’s “Password Security: A Case History” by Robert Morris and Ken Thompson, which talks about how password encryption evolved in early UNIX: https://rist.tech.cornell.edu/6431papers/MorrisThompson1979.pdf
And here’s the “support the channel” links (my video isn’t sponsored):
👕 Buy my nerdy ethernet t-shirt: https://vkc.sh/merch
✨ Join the Patreon (with Discord/Matrix benefits): https://patreon.com/VeronicaExplains
☕ Or Ko-Fi if that’s your jam (same benefits): https://ko-fi.com/VeronicaExplains
Chapters:
0:00 I say “greetings” and introduce the column command
0:58 Basic use of the column command
2:02 Piping more advanced commands into column
2:57 Column’s table mode: unlocking power
4:18 Adding neat headers to our table so we can manipulate them
5:57 Getting JSON output from terminal commands using column
6:57 Conclusion: column is awesome
Licence: Attribution - Non Commercial - Share Alike
23 Comments
Comments from other communities
i love this person's work; i've been working in the linux sphere for over 20 years but this person always teaches something that's new to me and more helpful than the tools i've been using to get the job done; sed/awk in this case. (plus, the sense of humor also makes it fun to watch).
i wish i were as rich as my fellow software engineers so that i can support her work because i'm convinced we need it in a world where people no longer have the same opportunities i had to learn this kind of tech because their smartphones inadvertently hide needful knowledge in the abstractions that make smartphones work.
She does a great job. Im trying to add in a couple of her videos when I see them into the different communities. I usually go to awk to be honest, so I completely blanked on columns. I knew it existed from like 10 years ago, but forgot what I can use it for. I learned something form this video :)
We need more entertaining Linux/open source people.
I've been following her for the past year, it's a pity she doesn't have a one time contribution scheme set up. I also can't support everyone but judging from the donations on KDE people do tend to give small amounts and it really helps. Gonna try to contact her and see if she can accept something like that
inadvertently
I don't think that word means what you think it means.
you think it's intentional?
Do I think it's intentional that smartphones are 'dumbed down' compared to PCs, so as to turn them into devices for mindless consumption of corporate-controlled media instead of devices for empowering user freedom? Yes, yes I do.
then its working very well; i learned this past xmas that my millennial/gen-z&a nephews/nieces are somehow less tech literate than their parents/grandparents.
my well wishing for this channel was in the hopes of reversing this trend, but maybe it's too little too late.
we need superman; not mr. rogers. lol
I don’t think they do it to make us dumber (there are other methods for that) but to make it accessible to people who don’t already know better.
So, in this case, inadvertent is correct;
Although it’s not without side effects.
Really cool tool
Her mentions of awk reminded me of a guy at my last job who was an absolute god with awk, but making changes to scripts he made were a nightmare because no one else could figure out what he was doing, and everything crashed and burned from small changes.
Awk is ok but often when I come across a script that I need to optimize because it's too slow, the easiest gains come from replacing awk command. Most of them use awk for the most mundane stuff that can easily be done with shell parameter expansion instead.
Damn, I could've avoided hours of scrolling up by now if I knew about this before.
If I need the top lines I usually just pipe output to less, but column is definitely going to help a lot!
Deleted by moderator
Yeah but I've always found I underestimate the amount of lines I needed to head.
tail I really only use with the -f flag to keep a tab on logs and the like.
This was a new one for me and I've been playing with linux for years. Also really enjoyed her video style so delved into some others.
Thanks for sharing!
Yup, found it just the other day when I wanted to have ls -l output in multiple columns instead of a single one.
column -s baby
When I first learned Unix (and then Linux) I just went through /usr/bin and looked at the man page for everything.
Then I browsed through the gnu info pages for bash.
There's no real alternative to RTFM.
I'm still sore that column -nts, doesn't work anymore. My mnemonic for remembering it was "unts, unts, unts" like a dance club beat.
Actually looking at the usage text I'm not sure how the -n flag ever worked for me... Maybe I'm misremembering.
It's one of the few things that I think Powershell did more cleanly than Linux, was making those kind of options a lot clearer and pushing people to use them early on in education cycles, so knowledge of these cmdlets is more common than the Linux equivalents. (I know that's harder to do with an all-volunteer OS built from the ground up versus a private company influencing education cycles, obviously. Linux always had the harder road.)
Format-Custom, Format-Hex, Format-List, Format-Table, and Format-Wide are pretty indispensable when working with Powershell.
Because precisely, 90% of the time, when it comes to Linux, the way you're taught is to just grep what you need out.
I've taken classes for both Powershell and Linux command line in college, and the PS class focused a lot on those commands while the Linux class *never once* mentioned column while spending a lot of time on grep.
Funnily enough, I use PowerShell as my daily driver and I rarely ever use the Format verb cmdlets and think they need to stop teaching people to use them as much as they do... They're only meant to modify how things are displayed, but in doing so, they trash the objects that were on the pipeline and replace them with formatting commands, and cause confusion when people try to do something with what they output
The worst is using them to select properties, they should not have included that ability at all, that's what the Select-Object cmdlet is for, which outputs usable objects
Anyway, sorry for the rant... I just think those overall teach new users bad habits.
I’ve taken classes for both Powershell and Linux command line in college, and the PS class focused a lot on those commands while the Linux class never once mentioned column while spending a lot of time on grep.
column belongs to util-linux
A Linux class. Never mentioned column. Mind == boggled.
Ironically grep is its own program. Although commonly it's the GNU one, so could be considered in the same group as coreutils.
Yeah but I keep trying to pipe the output back into the original file which ends up empty due to how pipe and redirect interact.
I know there must be a grown-up way to do it but I inevitably resort to writing it to filename2 and then running mv filename2 filename.
I learned to write scripts on Windows Powershell and got spoiled by everything being an object so when I started writing bash scripts I think 90% of the work is trying to parse the raw text output of commands with things like awk or sed.
I was going to post this but Lemmy told me your post was already here... nice.
I've been using Linux everyday for around 25 years and I'd never heard of the column command somehow!
Thanks for the video, as a bonus it is not on YouTube.
One should watch it.
Just in case TL;DR « man column »

Ive been looking into sdf.org. How is it? Ive only seen the website a bit so im wondering how it functions/community/etc...
The link that actually pays the creator: https://youtu.be/uL7KvRskeog
That's her own instance. On peertube.
So the link that costs her money?
Its the link she recommends on her channel.
It also has quite a few peers so its not all coming to her server. She talks about how she wants comments in peertube.
Jesus, lemmings are a hard crowd to please. I've watched it on the peertube, but bought some overpriced t-shirts from her shop. Would that be an acceptable approach? :)
My comment wasn't serious
Well, you should consider guerilla marketing as a career option, because those t-shirts are seriously on the way as a direct consequence of your post :D
I wish I could but I'm assuming @april@lemmy.world deserves the credit. I didn't start the comment thread. But either way that's awesome.
PieFed
Very cool.
@vkc would love that "awk for beginners" video
Killer video. About lept from my seat when the JSON output was shown.
@vkc
Yes, great command to format those tools that cram everything together!
I added it yesterday to my list of Linux commands that I'm working on: linux-audit.com/system-adminis
My hope is that it inspires others to discover new handy tools ⚙️ 💪🏻
@vkc
Thank you, I'm sure it will soon be helpful !
I've been a damn Linux admin off and on for 25 years. Somehow I never knew about column. I was doing abusive things with grep, awk, sed, and other utilities to accomplish what "column" does with a simple -t.
HOW THE CRAP DID I ONLY HEAR ABOUT IT NOW‽‽?
@anonymous_freak@tilvids.com i feel the same way.
@vkc Gonna send this along to a pal of mine who is just getting started with Linux. I didn't even know about the JSON option!
3:25 Sorry, I just can’t help… 😂
@vkc I really enjoy your videos, they're fun and informative and it's an absolute delight whenever there's a new notification
@vkc piling on to +1 for that awk video—but also this `column` command is so cool! It'll keep me going for a while, and like many here I'm wondering why I never heard about it before 😮
awk is an awesome tool. I'd like to see a lesson on it. Such simple tools can completely replace much more complicated software like the usual spreadsheets and everything is already part of the operating system. You don't need to do anything.
@vkc Thanks, I somehow didn't know about that command.
OMG THIS IS AMAZINGGG THANK YOU >3
@vkc Wow! I've been using Linux for like 10 years and had no idea this command existed. Thanks!
Nice. I've previously done all these things with combinations of sed, awk, and cut.
@vkc This came up in a YT recommend. I've been using Linux for over 25 years and have never seen this command!
I use `cut` and it is clunky even for the subset of things it can do that `column` does better.
@vkc "column" was new to me (but then again, my Mac just arrived last week).
Would love to see an awk introduction.
@vkc Thank you so much! I recently though of such a tool as I had a long list of metrics, too long to be observed with "watch". (For some reason, I didn't search the web to find one.)
Now I can produce a neatly formatted two-column table, which is still very long, but send it through "column" again to fit it on a single page.
I cannot emphasise enough how great this is!!
@vkc I always forget the name of column, (as well as comm), though I never forget the name of fold; those three commands are among my least used unix utils.
The text in the thumbnail is truly "horrifying".
I think an AWK for beginners would be a cool video.
@vkc AWK for absolute beginners -video would be very interesting. Never used that one.
Column command I was somewhat familiar with, but had completely forgotten about it.
Thanks for the video! 😄