Have you ever used the "column" command? (tinkerbetter.tube)
from mesamunefire@lemmy.world to linux@lemmy.ml on 05 Jan 19:23
https://lemmy.world/post/23920047

#linux

threaded - newest

SnotFlickerman@lemmy.blahaj.zone on 05 Jan 19:31 next collapse

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.

Zucca@sopuli.xyz on 06 Jan 00:46 next collapse

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.

laurelraven@lemmy.zip on 07 Jan 03:35 collapse

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.

SnotFlickerman@lemmy.blahaj.zone on 07 Jan 04:10 collapse

Don’t be sorry for having an opinion, and that’s a pretty mild one all things considered.

UxyIVrljPeRl@lemmy.world on 05 Jan 19:46 next collapse

That’s the first time i read about column…

alienzx@feddit.nl on 05 Jan 20:01 next collapse

column -s baby

Zucca@sopuli.xyz on 06 Jan 00:39 collapse

baby separated values?

eager_eagle@lemmy.world on 06 Jan 02:36 collapse

it’s like CSV, but larger and keeps you awake at night

eldavi@lemmy.ml on 05 Jan 20:02 next collapse

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.

mesamunefire@lemmy.world on 06 Jan 00:21 next collapse

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.

eldavi@lemmy.ml on 06 Jan 00:46 next collapse

We need more entertaining Linux/open source people.

i think that this is what sets her apart from most; the sense of humor makes the video edit entertaining to watch like the on screen comments.

marlowe221@lemmy.world on 06 Jan 16:44 collapse

Veronica is awesome and deserves a bigger following, no doubt.

grue@lemmy.world on 06 Jan 01:04 next collapse

inadvertently

I don’t think that word means what you think it means.

eldavi@lemmy.ml on 06 Jan 01:08 collapse

you think it’s intentional?

4am@lemm.ee on 06 Jan 01:39 next collapse

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.

eldavi@lemmy.ml on 06 Jan 01:51 collapse

my new found media literacy is making me paranoid and OH BOY does this create all sorts of conspiracy rabbit holes for me to get lost into. lol

michael@lemmy.chrisco.me on 06 Jan 03:18 collapse

Agreed!

grue@lemmy.world on 06 Jan 02:21 collapse

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.

eldavi@lemmy.ml on 06 Jan 02:49 collapse

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

nfms@lemmy.ml on 06 Jan 12:24 collapse

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

DasFaultier@sh.itjust.works on 05 Jan 20:05 next collapse

Of yes, I have! alias nfsmounts=‘mount | grep “nfs” | column’

[deleted] on 05 Jan 20:16 next collapse

.

davel@lemmy.ml on 05 Jan 20:16 next collapse

I doubt anyone has ever regretted spending some time familiarizing themselves with the POSIX, util-linux, and GNU coreutils commands. You can do a lot by just piping these (mostly) simple tools together.

Classy@sh.itjust.works on 06 Jan 00:35 next collapse

Something else, all of the GNU coreutils have their own info [command] terminal command, and often the info page is incredibly easy to read, full of example pages and highly granular descriptions of flags, error messages, and the like.

davel@lemmy.ml on 06 Jan 00:40 collapse

Yeah GNU’s info pages are often more detailed than the man pages.

lars@lemmy.sdf.org on 06 Jan 14:57 collapse

Is awk the best POSIX-compliant column emulator?

MonkderVierte@lemmy.ml on 06 Jan 15:36 collapse

I would say sed.

Geometrinen_Gepardi@sopuli.xyz on 05 Jan 20:19 next collapse

Damn, I could’ve avoided hours of scrolling up by now if I knew about this before.

lord_ryvan@ttrpg.network on 06 Jan 07:07 collapse

If I need the top lines I usually just pipe output to less, but column is definitely going to help a lot!

Quereller@lemmy.one on 07 Jan 12:21 collapse

There is also head and tail.

lord_ryvan@ttrpg.network on 08 Jan 08:28 collapse

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.

metaStatic@kbin.earth on 05 Jan 20:22 next collapse

cat /dev/hda1 | column | lolcat

plasticcheese@lemmy.one on 06 Jan 00:39 next collapse

mount | column -t -s " "

Ahhhh…sanity. Thanks lovely Internet lady

GhostlyPixel@lemmy.world on 06 Jan 06:27 next collapse

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.

mesamunefire@lemmy.world on 06 Jan 06:30 next collapse

Sometimes a small python script that is readable is better for long term support.

QuazarOmega@lemy.lol on 06 Jan 10:32 collapse

Sometimes

Always*
Shell scripting for serious tasks should crash and burn, wherever possible at least

LiveLM@lemmy.zip on 06 Jan 15:01 collapse

For all that I shit talk Microsoft, Powershell does seem better suited for production tasks than bash and friends…

MonkderVierte@lemmy.ml on 06 Jan 15:34 next collapse

Powershell may be better for programming but is worse for shell tasks.

QuazarOmega@lemy.lol on 06 Jan 16:26 collapse

Absolutely, the syntax and API isn’t exactly easy, but it is miles better because it’s both more familiar to other programming languages and because it is verbose.
I argue that the complaint some have about its verbosity is of little meaning, those people have just used the shell so much that they naturally remember a lot of commands, what they’re used for and their specific syntax, but for a beginner it’s difficult to string everything together, because a lot of tools are of independent origin. Regardless, Powershell should by default have quite a few aliases to the commands/functions with long names so it’s not like you can’t have the best of both worlds

laurelraven@lemmy.zip on 07 Jan 05:31 collapse

Yep.

I use it as a command shell regularly and the verbosity isn’t an issue at all, between aliases and tab completion.

Honestly, having used both for years, PowerShell is actually easier in many respects just due to the object pipeline and dotnet, once you get to know them well enough. Being able to just toss output into a variable and mess around with it to understand its structure and contents is huge

Cyber@feddit.uk on 06 Jan 06:57 next collapse

Documentation & comments… the most underated part of any system

somenonewho@feddit.org on 06 Jan 16:45 next collapse

Oh I’ve done some wicked shit with awk that things literally magic

shasta@lemm.ee on 07 Jan 05:35 collapse

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.

justin@lemmy.kde.social on 06 Jan 06:49 next collapse

I have, but I also learned a few new things about column from this video, nice!

nore@sh.itjust.works on 06 Jan 07:34 next collapse

Yup, found it just the other day when I wanted to have ls -l output in multiple columns instead of a single one.

BananaTrifleViolin@lemmy.world on 06 Jan 16:58 next collapse

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!

markstos@lemmy.world on 06 Jan 17:05 next collapse

Yeah, not sure how I missed this one!

Allero@lemmy.today on 06 Jan 17:39 collapse

Veronica is long in my playlists, never disappointed

grrgyle@slrpnk.net on 06 Jan 17:51 next collapse

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.

AnUnusualRelic@lemmy.world on 07 Jan 11:51 next collapse

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.

caseyweederman@lemmy.ca on 08 Jan 00:52 next collapse

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.

Toribor@corndog.social on 08 Jan 20:54 collapse

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.

[deleted] on 09 Jan 02:06 collapse

.