- cross-posted to:
- peertube@lemmy.world
- videos@lemmy.world
- linux@lemmy.world
- cross-posted to:
- peertube@lemmy.world
- videos@lemmy.world
- linux@lemmy.world
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.
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.Yeah GNU’s
infopages are often more detailed than themanpages.
Is
awkthe best POSIX-compliantcolumnemulator?I would say sed.
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.
Sometimes a small python script that is readable is better for long term support.
Sometimes
Always*
Shell scripting for serious tasks should crash and burn, wherever possible at leastFor all that I shit talk Microsoft, Powershell does seem better suited for production tasks than bash and friends…
Powershell may be better for programming but is worse for shell tasks.
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 worldsYep.
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
Documentation & comments… the most underated part of any system
Oh I’ve done some wicked shit with awk that things literally magic
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.
mount | column -t -s " "
Ahhhh…sanity. Thanks lovely Internet lady
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, butcolumnis definitely going to help a lot!There is also head and tail.
Yeah but I’ve always found I underestimate the amount of lines I needed to
head.tailI really only use with the-fflag to keep a tab on logs and the like.
That’s the first time i read about column…
cat /dev/hda1 | column | lolcat
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!
Veronica is long in my playlists, never disappointed
Yeah, not sure how I missed this one!
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, andFormat-Wideare 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
grepwhat 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
columnwhile spending a lot of time ongrep.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.
columnbelongs to util-linuxA Linux class. Never mentioned
column. Mind == boggled.Ironically
grepis its own program. Although commonly it’s the GNU one, so could be considered in the same group as coreutils.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.
Don’t be sorry for having an opinion, and that’s a pretty mild one all things considered.
I have, but I also learned a few new things about column from this video, nice!
Of yes, I have!
alias nfsmounts='mount | grep "nfs" | column'column -s baby
baby separated values?
it’s like CSV, but larger and keeps you awake at night
Yup, found it just the other day when I wanted to have
ls -loutput in multiple columns instead of a single one.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
-nflag ever worked for me… Maybe I’m misremembering.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.












