The Changelog: Software Development, Open Source - Modern Unix tools (Interview)

Episode Date: July 31, 2021

This week we're talking with Nick Janetakis about modern unix tools, and the various commands, tooling, and ways we use the commmand line. Do you Bash or Zsh? Do you use `cat` or `bat`? What about `ma...n` vs `tldr`? Today's show is a deep dive into unix tools you know and love, or should know and _maybe_ love.

Transcript
Discussion (0)
Starting point is 00:00:00 This week on The Changelog, we're talking to Nick Genatakis, our good friend, about modern Unix tools and the various commands, tooling, and ways we use the command line. Do you bash or ZSH? Do you cat or bat? What about man versus TLDR? Today's show is a deep dive into Unix tools you know and love, or should know and maybe love. Big thanks to our partners Linode, Fastly, and LaunchDarkly. We love Linode, they keep it fast and simple. Get a hundred thousand credit at linode.com slash changelog. Our bandwidth is provided by Fastly. Learn more at fastly.com
Starting point is 00:00:31 and get your feature flags powered by LaunchDarkly. Get a demo at launchdarkly.com This episode is brought to you by Influx Data, the makers of InfluxDB, a time series platform for building and operating time series applications. In this segment, Marian Bija from NodeSource shares how InfluxDB plays a critical role in delivering the core value of the APM tool they have called Nsolid. It's built specifically for Node.js apps to collect data from the application and stack in real time. At NodeSource, we want to lean into a time series database and InfluxDB quickly rose to the top of the list.
Starting point is 00:01:10 One of the unique value propositions of EnSolid is real-time data and there is a lot of APM tools out there, but there is a variance in terms of how available the data is. It's not really real-time, there is actually a staging period to the data, and InfluxDB is magical and allows us to deliver on our unique quality proposition of real-time data with Ensoly. To get started, head to influxdata.com slash changelog. Again, that's influxdata.com slash changelog.
Starting point is 00:02:00 All right. Well, we have Nick Jantakis here. Nick, thanks for coming on The Change Log. Yeah, no problem. Happy to be on. Happy to have you. I feel like we've talked a lot, been around each other a lot. I had you on backstage, but this is your first time on The Change Log.
Starting point is 00:02:17 You've been doing freelance development work, creating courses. You have the excellent Running in Production podcast. Tell the folks a little bit more about yourself, the kind of courses you do, and what you're into. Yeah, so I am a freelance developer, also a course creator. So the Running in Production podcast is basically where I just talk to folks about how they're building and running web apps in production in terms of like courses and blogs and videos, all that fun stuff. Yeah, it's just basically everything I've learned along the way, just being, I guess, a standard developer. I'm mostly focused on developing web apps and deploying them, command line stuff. So you're here because you're like me,
Starting point is 00:02:48 you're kind of a command line junkie, right? You do lots of command line stuff. A little bit, yeah. A little bit. And you're also modest, more modest than I am, which is a nice thing. Today's show, we thought we would talk about modern Unix. So there's this cool repo on GitHub.
Starting point is 00:03:01 It's called modern Unix. It's maintained by a fellow named Ibrahim Ahmed, who's an open source enthusiast and a freelancer in Toronto. And what he's put together, it's one of these kind of awesome list style repos where it's really just a curation of a group of things that he thinks are high quality. And this is specifically a collection of modern
Starting point is 00:03:22 slash faster slash saner alternatives to common Unix commands. And as I scrolled through this list, I saw a bunch of tools that we've kind of covered over the years on Changelog News. But I hadn't seen everything all together in one place. Like if you like Unix-y things and maybe the initial tools leave you wanting or you just like to have something new and shiny, this was a really cool place to go. So looking at this repo, I had a few thoughts. First of all, what are the commands that developers actually use on a regular basis? I have a sample size of one,
Starting point is 00:04:00 but I thought I'd get you on here to ask you that question as well, Nick. What are the common commands? What job do these commands perform for us? What are we trying to do with them? How are they serving us? And then are the age-old versions sufficient? Or are they long in the tooth? Do they have things that just don't keep up with what we do in modern times? And then we have all these modern replacements,
Starting point is 00:04:21 and it's like, are the modern versions better? How are they better? Is it worth the installation? And so on and so forth. So that's the idea for today. I thought we would take up these topics. What do you think? Yeah, I think that's a great idea because, yeah, I've looked at that repo before at a
Starting point is 00:04:38 glance and there's what, maybe 10, 15, 20 different tools there. But in terms of like, what do I use in my day to day? So, you know, besides the super basic ones like CD or LS or whatever. Yeah, I'm using Grappaton. I use Auxed, Cut. Do you know Cut, like the Cut utility? I've used it in like a pipeline before, but I can't remember what it does. Can you tell us?
Starting point is 00:05:02 Yeah. So like, let's just say for argument's sake, you have something like a CSV file that has comma-separated file, and you just want to get the third column there. So you can use cut there to be like, okay, I want to delimit on a comma and get the third one. But you can do it on other things than a comma, basically any character of your choosing. But it comes in handy just to parse out tabular data.
Starting point is 00:05:19 Yeah, so those are probably my go-tos in my day-to-day. I mean, there's so many specific little things, right? I guess it's depending on what you're developing. But yeah, I would say grep and set are like my go-tos for a lot of things. My go-to is ll. Double L. Double L, which is an alias, right? Double L.
Starting point is 00:05:38 It's an alias, yeah. And it's actually an alias via omyzsh. Nice. I don't use anything but. And that's an alias that oh my zsh nice uh i don't use anything but and that's an alias that comes with that which basically is ls dash l for long list right and i just hate typing ls dash anything really so i'm just like ll so much shorter this is so much easier i mean i guess you could auto LL on CD, but whatever. That's my most common one. Yeah, so I have tons of LS aliases.
Starting point is 00:06:10 Similar, I have LL as well. Ooh, I rhymed. I also have combinations like LLD, which will long list the directory, I think sorted by file size. And then there's like LLS, which is like sorted by age like last modified time i can't remember i do them like with my fingertips i can't think of them out loud but i have probably like 8ll and then some sort of modifier just to save me from typing ls dash
Starting point is 00:06:39 l ht or whatever it is to uh to have to remember those incantations. It's nice to just remember those. Yeah, I think there's another one too, like dash capital R. So it does like a recursive LS and you can see all the files in different directories that you have. Yeah, and I just made the mistake
Starting point is 00:06:57 of typing that in as you talked on a band directory with a bunch of stuff in it. And it's still scrolling to this point. So is that similar to tree? Yeah. I was going to say it's a little bit similar, but it gives a little bit more information.
Starting point is 00:07:10 So like if you were to do your LL, like imagine running LL, but it like goes through every directory and gives you the output of that recursively where tree is kind of cool. Like that's a good one that you brought up. Tree is kind of like what's in here to the deepest level or to a certain level. Tree will,
Starting point is 00:07:24 we'll explain, we'll actually lay out the hierarchy as well. Correct? Yeah. is kind of like what's in here to the deepest level or to a certain level tree will will explain will actually lay out the hierarchy as well correct yeah yeah it's more about like yeah exactly the hierarchy of all the different directories beneath it and tree is a page page i believe like it's always and i mean let's see if that's true no it just spits it out i think you can pipe it into less or something to add pagination, but I don't think Tree is actually a built-in. I think Tree is something
Starting point is 00:07:50 that's like... It's definitely not on a Mac, I'm sure. Common, but... I don't think it's built-in on Unix, personally. I could be wrong.
Starting point is 00:07:57 I use it, I do install it via Homebrew, thank you. And I do use it somewhat often, often enough to actually install it. Yeah.
Starting point is 00:08:04 So, yeah, I'm the same way if i'm running debbie and orbuntu you just have to install tree and you're good to go yeah so one thing that's interesting we talk about modern unix tools and i think there's confusion sometimes and maybe i'm just projecting about exactly what unix is versus linux There's like the all caps Unix. You'll see like just capital U Unix. You'll also see people using it as a non-proper noun like Unix-like and it's lowercase Unix. Then there's Linux. Adam just mentioned Mac OS is using tools
Starting point is 00:08:40 that are on Linux. They're also on, you call them Unix. And so I thought, what if we went ahead and gathered some of the information, just for people who don't know some of the history, some of the inner workings and the relationship between these terms and what they are, and provided a little bit of that context before we dive further into the individual tools that we're going to cover. Sound good? Sounds good.
Starting point is 00:09:02 Sounds good. Although it's funny, you mentioned like the lowercase unix versus capital U versus like fully uppercase unix. Yeah. It reminds me of that like English grammar trick, like the Buffalo, Buffalo, Buffalo, Buffalo thing. Do you know that one? I don't, please tell us.
Starting point is 00:09:14 No, what is that? Like if you literally say the word Buffalo seven times in a row with certain capitalizations, like an end sentence being like a grammatically correct English sentence based on like what a Buffalo is and like Buffalo the town in New York. Like I don't know it well enough to explain it, but it reminded me of that. Now that you say that, it does kind of ring a bell. I think I've tried to figure it out and it doesn't make, it doesn't seem like it would make sense,
Starting point is 00:09:35 but when you see it in context with all the capitalizations incorrect, it actually is a full sentence, right? That's crazy. But sorry to interrupt. Yeah. Let us know the differences between Unix and Linux. Yeah, so this is just going completely off the top of my head. I mean, I didn't read it off Wikipedia, but if I was going to write a Wikipedia, I might say a few of these sentences. So, the original Unix is AT&T
Starting point is 00:09:56 Unix, and that was started in the late 60s, early 70s at Bell Labs. Right. So that's like the OG. It wasn't even open source, it was proprietary. AT&T licensed Unix to various parties in the 70s, and that led to the different Unix variants.
Starting point is 00:10:12 You see Berkeley's BSD, Sun's Solaris, IBM's AIX, and there's more than just those. Now, all caps Unix, that's the trademark, which AT&T owned until the 90s. Then it sold to Novell, which then sold the UNIX business group to somebody else.
Starting point is 00:10:33 But then they kept the copyright, which eventually ended up at the Open Group, which is like a consortium of different entities. No idea if they still hold it or what. So like capital, all caps UNix, that's Unix the trademark. Of course, there were legal disputes along the way, but those are not interesting. Back in the 80s, the GNU project began, which was an effort to create a free software Unix-like system. You probably have heard of GNU, stands for GNU's not Unix. It's not Unix, but it's Unix-like. And it's famous for many things, not just the invention of the recursive acronym,
Starting point is 00:11:14 which is pretty rad and has been copied over and over again. What else does GNU do? The GPL, the GNU General Public License, GNU's compiler core. What's GCC stand for? GNU's compiler something. They got GCC. Of course, the core utils like LS, RM, et cetera, and more.
Starting point is 00:11:33 They have their own core util that they implemented. So GNU had a lot of things going, but they didn't really have a working kernel. There was GNU Herd, H-U-R-D, which was being worked on back in the early 90s, but didn't totally work yet when Linux came around. Of course, Linus Torvalds released Linux back in 1991, and that's a kernel. So the Linux kernel is an operating system kernel. It's not an entire operating system. He released that as GPL, so it got integrated with a bunch of other GPL stuff.
Starting point is 00:12:05 And then there's also the BSD Unix effort, which was released in 1992. That led to NetBSD, FreeBSD, later on OpenBSD, and I think Dragonfly? A few others. I honestly don't know very much about BSDs. I do know there's some people that are very
Starting point is 00:12:21 passionate about BSD, but I don't know very much about BSD. What about you, Nick? Have you dove into the BSD side of things at all? I have not. It's funny, like, you know that story behind Richard Stallman, where, and I'm not calling him out to, like, make fun of his philosophies or whatever,
Starting point is 00:12:38 but, you know, Linux is called Linux, but then he thinks it should be called GNU Linux because, really, it's like you're getting the Linux kernel, but you're also getting these GNU programs like LS and GRAP and SET and all of them. So it kind of makes sense that you're combining both of these together to give you an endgame solution so that we, the end user, actually have something to run in user land code.
Starting point is 00:12:56 Yeah, absolutely, because Linux by itself is not an operating system, right? It's just the kernel. So you have to combine Linux with other things to create an operating system. These are the Linux distributions, which we know very well. Arch Linux, Ubuntu, Debian, Gentoo, Suze, Fedora, CentOS, Rocky Linux, all these things. I just keep listing them and listing them. But you bring up a great point, though, by the way, because there's such a difference between the GNU version of SED and the FreeBSD version of it.
Starting point is 00:13:28 And that's why you can't use certain SED flags on macOS versus maybe Debian or Ubuntu or whatever distro that you like to use that uses GNU SED. Have you ever noticed that with a dash i flag? You can't do in-place edits when you're trying to redirect out to a file in macOS? I've been on macOS for so long that I don't know probably the intricacies. I don't work too much in Linux anymore like I did back in the early aughts. I do notice some of the I have to send different
Starting point is 00:13:53 flags. In my Bash RC, I'll have slightly different aliases depending on if the OS is Darwin or not, if I'm on Mac or not. I don't remember what they are. I think maybe even LS might have a slightly different way of coloring files or something like this. The DNS flushing, you know, the DNS
Starting point is 00:14:10 cache is slightly different. So that is interesting, and it's based on the roots of the operating system, right? The BSD side versus the Linux side. Yeah, so Linux and BSD, they have more in common than they have in difference. I mean, they're very similar, but the differences are what we focus on, of course, because those are the interesting bits.
Starting point is 00:14:27 That's what makes it unique. That's why we should even have more than one in the first place. But what they have in common is the Unix philosophy and the Unix architecture. The Unix philosophy is something we talk about on the show all the time. In fact, we just talked about it with Matt Reier with his tool Xbar and how it accidentally followed some of the Unix philosophy and had some awesome results from that. So we talk about that a lot. The Unix philosophy includes ideas like make each program do one thing well, write programs that work together, and write programs that handle text streams, because that's universal interface. So everything
Starting point is 00:15:01 is text. If you can assume it's text, then you can write more simple programs that work with more things. Then there's a Unix architecture, which has the unified file system. It uses inter-process communication through pipes. We've already talked a little bit about pipes to serve as the primary means of communication. It also includes a shell scripting
Starting point is 00:15:21 and command syntax called the Unix shell, which brings us kind of full circle, right? So when we talk about unix tools or modern unix we are mostly referring to programs that follow the unix philosophy run inside the unix architecture and are executed from a unix shell this could be on bsd this could be on a linux distro or it could be on mac os all of which are unix-like systems. Just off the top of my head. Yeah, right. That was a good one.
Starting point is 00:15:57 Well, the important thing, I think, with maybe this discussion, too, when you say modern Unix tooling, right, or tools that you can install, is that you don't have to accept the sed that comes with. You can accept an alternate that may be community-driven, which I think is empowering to users, right? Like being able to install Tree despite it not being installed directly on the OS. That's sort of par for the course, but new folks coming to the command line even or being a daunting thing for them, understanding how they can choose the different tooling, maybe even installing it via HoBro if they're on macOS or AppGate if they're on Linux or something like that, a different version of that. I think that's cool. Being able to say, well, this version of LS comes with Unix, the GNU version or however, whatever the history is that you just described. But if that doesn't work for you and there's a community-driven version of it that might have different
Starting point is 00:16:44 features or different things that are maybe, in this case, modern with the way modern things are going. In fact, behind the scenes, we have a Unikernel's post coming out soon by Ian Iberg. developed by Bell Labs back in the 70s was built for computing in that day where if we considered what an operating system for the data center might be like today in 2021, how will we design that? And I think you might get different results with maybe, LS may be a good example because it's just simply listing directories, but maybe SED might be different or with some of these tools you're going to get different results based upon today's needs yeah and being able to install
Starting point is 00:17:30 them you know if you want to just boom install it you're done use it yeah i think there's an interesting conversation around that because it's like do you know some folks where they install vim and they're like well i want to be a purist and not install any plugins so that if I were to ever SSH into another machine, then my environment there is going to be the same as it is on my dev box. Because, you know, Vim is probably going to be installed there. You don't need to worry about different plugins. And I think that's similar to this type of thing that we're talking about here, because when it comes to installing like a separate version of LS or something like that, like, I don't know, it's a weird one, right? It's like, you kind of want to optimize for what you're doing most of the time, like 95% of the time. So like in the Vim case, that would be like install whatever plugins you need to make things work. But I think one of the beautiful things about just the command line in general is,
Starting point is 00:18:17 you know, like things like SAD and grep and LS and whatever, it's like, once you know them once, you kind of know them everywhere. So I'd be curious to know, like, you know, I haven't used like the custom version of LS, the one from modern Unix tools, but I wonder if the flags are the same or are they different? Because I think it would be harder to get me to use it if it were to be different. Yeah. How compatible are they with like,
Starting point is 00:18:37 while modern, how backwards compatible are they? Do they just simply, are they additive or subtractive? The same thing with me. I don't actually use Vim, but I use VI a lot. I will favor VI more than anything because it's just simple. I'm just trying to get in, edit a file, get out. I'm not trying to do programming. I'm just more or less editing config files or messing with DNS stuff or whatever it might be.
Starting point is 00:19:00 Adding a cert or confirming a cert is there in the known hosts, whatever. That's the things I'm trying to do. So I'm not actually like opening up Vim myself personally. So I'm not like installing a special version of VI, for example. I think that's a good example because I think what you'd find, Adam, is that at the base level that you're using VI, using Vim, you will find is identical. You wouldn't notice a difference if you're just opening files. Every time I get into Vim,
Starting point is 00:19:30 I get stuck. That's why I favored VI. Well, you get stuck for those reasons. Every time I'm trying to get out, I can't get out. Yeah. I'm not sure how you're
Starting point is 00:19:39 getting out of VI, but... You know, I don't know either. Maybe I found tricks. Maybe it's just simply fear that keeps me away and less logic. It's more fear than logic. Yeah, so I think that's a good example.
Starting point is 00:19:51 I think a lot of these tools, we're going to talk through some of them. Some are meant to be direct replacements. So in the case of Exa, we're going to get into this with LS. It's basically like you could alias Exa to LS and not know the difference and just keep typing LS and it's supposed to be a drop- exa to ls and not know the difference and just keep typing
Starting point is 00:20:05 ls and it's supposed to be a drop-in replacement other ones are not really what you call they're not really api compatible but command compatible i mean the flags for instance i guess the flags are an api to a certain extent they're meant to be used instead of but not really to like plop on top of or replace one-to-one an older version so we can talk through some of those i know i'm kind of in the keep it vanilla er camp nick i'm not sure it sounds like you're kind of in that one as well yeah but i think it's kind of like progressive enhancement on the web you know so i have my personal cd built in wrapped with a cd function that i wrote which provides additional functionality and mostly what it does i think maybe just the only thing it does is it just
Starting point is 00:20:53 automatically calls ls anytime i change to a directory because i just found what i did every single time like what do you do right after you see the ls cd ls right so I just monkey patched my CD to just do the LS for me right when I enter any new directory. Just go ahead and display what's in there. I find that to be additive though, right? Kind of like a progressive enhancement because then when I go to another system that doesn't have that,
Starting point is 00:21:17 then it just doesn't do it. It's like an operator overload, but you're not making it do some sort of destructive or random thing that you wouldn't expect. So I don't find it problematic that way. I think with Vim it is so complex where if you do trick it out
Starting point is 00:21:30 completely, you go to another system, you don't know how to use the bog standard Vim anymore because yours is so customized. I think that's what you're speaking to. But some of these are so simple that as long as you're just adding functionality and not removing or changing it, that in practice I'm not sure if it would really be a problem.
Starting point is 00:21:46 Yeah, I think if things stay the same, but you get more new stuff, that's a good way to go about it. Like, I would be less opposed to not trying it out. You know how it is with some of these command line tools, right? Trying to remember some of those flags for all of them can be very, very difficult. Like using the tar command or something to like unzip a GZ file, right? It's like those flags are very very very confusing the only way i remember that one there's like this stupid little honored
Starting point is 00:22:09 schwarzenegger meme where it has a picture of him and then there's like the flags where it's like extract c file verbose me down where it's like xz f v or something like that right yeah yeah i think tar is the poster child for impossible, inscrutable command line flags, right? Like we've all kind of memorized ZXVF, CSV, Z, and you're just like, I don't know what any of these mean.
Starting point is 00:22:32 But we brought up about, you know, running an LS after CD is really, really cool, right? It's like, that's the really cool thing about using the shell. It's like,
Starting point is 00:22:39 you can just make an alias to CD where I'm guessing it, what it's just CD and, and LS or whatever, right? Yeah. I'm looking at it now. It basically does like does like there's like there's two if statements that are nested it's the one condition is do i have any arguments or zero arguments right so if i call cd with nothing it goes home right if i call cd with arguments it goes to where i say it's going to go
Starting point is 00:22:58 so it kind of if the first case it just calls the built-in and then calls ls-g if the second case then there's another if statement so it's probably like 10 lines of code uh if i'm passing dot dot which does to go up a directory then it will take a specific case for that otherwise it just passes my arguments directly into the built-in and calls ls and so yeah you're basically just calling ls after you do what you're gonna do with some of the slight little tweaks to make sure you don't futz up with any of the arguments that you're receiving. Yeah, I've got similar aliases like for Vim. So I happen to use Vim on the command line, but you can use Vim to diff two files side by side, which is kind of nice. You know, you kind of get like a GitHub side by side view of that.
Starting point is 00:23:38 But as far as I know, Vim doesn't have a really great way to do diffing two different directories, like multiple files in a directory. So I wrote a little alias that either runs Vim if you're passing in two files as arguments, but if you're passing in two directories, then it just runs a different command, which is like a Vim plugin that handles doing a directory diff. But from my point of view, I just run one command and it figures out the dirty work behind the scenes.
Starting point is 00:24:00 One more shout out to OhMyZSH. I just do dot dot to move around as well. so if I'm in a directory I want to go back rather than going cd space dot dot I just type dot dot It's like it's cool It's so efficient
Starting point is 00:24:15 Do you know what that's doing behind the scenes? It's just calling cd I suppose I imagine it's probably just doing cd I don't know That's the other thing I remembered my cd function does I'm starting to realize this thing's more powerful than i ever expected it will take cd dot dot dot and go up two directories and dot dot dot and go up three so oh my zsh does that so that's spectacular because who wants to go dot dot slash dot dot slash dot dot slash nick even nobody
Starting point is 00:24:41 even type in dot dot slash all this time or what do you do? So, okay. I have an interesting take on this one because I would love to be able to do the dot dot dot stuff. But if you're recording video courses or doing YouTube videos, sometimes it's hard for other folks to follow along if they don't have those aliases set up. And if I have to like segue into, by the way, I have this alias for every single one, then it becomes like not really sustainable. So, yes, I do the dot dot slash dot dot slash dot dot slash. Like a chump. No, that's actually a really good reason. And also a good reason to keep your Vim kind of standard, especially if you're going to be pair programming
Starting point is 00:25:12 or if you're going to be instructing people, is that if you have a completely customized Vim and you're trying to teach programming, all of a sudden you're teaching Vim customization, right? Sort of, kind of. I mean, in that regard, I optimize for me. So I do have like, I don't know, 50 or something plugins and it's all set up. But I have all of that available on my.files and GitHub. And I have everything installable where it'll work if you're using
Starting point is 00:25:32 macOS or any distro of Linux. So it's very easy for folks to just copy paste stuff if they want. But yeah, when it comes to like teaching like a video course on programming, I try to like, sure, I'll link to my.files and let people know like how to set up their environment. But I don't want them to go on like a side quest where it's like seven hours to get Vim configured when they can just use VS code or sublime text or, you know, whatever editor they happen to be using already. So I did some more hunting while you're talking there, Nick. And so every dot takes you back a directory. Nice. So as far back as you are, if you want to go back five, you five dots enter. Kind of cool cool so what happens if you put in like 45 dots
Starting point is 00:26:06 does it like recursively go back around back in time it might go back in time i think it just goes back as far as i can to the rut yeah yeah This episode is brought to you by our friends at LaunchDarkly, feature management for the modern enterprise, power testing in production at any scale. Here's how it works. LaunchDarkly enables development teams and operation teams to deploy code at any time, even if a feature isn't ready to be released to users.
Starting point is 00:26:56 Wrapping code with feature flags gives you the safety to test new features and infrastructure in your production environments without impacting the wrong end users. When you're ready to release more widely, update the flag status, and the changes are made instantaneously by the real-time streaming architecture.
Starting point is 00:27:11 Eliminate risk, deliver value, get started for free today at LaunchDarkly.com. Again, LaunchDarkly.com. So you've probably used cat a few times actually what is that one command that you can run to see your most used commands that you've run in your history so history is the history command there is a command that will do that what was it adam we were just using it the other day that's bugging my mind too how do you recall it though it's Adam? We were just using it the other day. That's bugging my mind, too. How do you recall it, though? It's one of those things where... I think it's history. No, it's not history. History is just a list.
Starting point is 00:27:49 I saw a bunch of numbers. They'll sort them by the times you've used them and show them to you. We should actually look that up and we'll go back in. That way we'll have it. Maybe one of those things where you're just piping together a couple of commands, like maybe history with sort, possibly. I'm not really too sure, but it's one of those things where cat is up there, probably, as like top-ish type of
Starting point is 00:28:08 command, along with get. Let's see. Here it is. History, pipe it into set, pipe it into sort, pipe it into unique-c, pipe it into sort-rn, head-10. So here's a good use of the Unix command line right here. I will throw it in the chat. We can all execute this.
Starting point is 00:28:24 And you can see what makes your top 10. I don't have cat in here. Do you have cat? I do not. I thought it would be for sure, but no. I think it takes, if it just did the commands themselves, I think you'd probably have better. But for instance, if you pass, like mix test is one of mine, right?
Starting point is 00:28:41 So that's mix plus the specific command inside of the mix command so in there I've got one, two, three of them are git so that should just be one so this particular one that I found on Stack Overflow is not sufficient I type exit a lot apparently it's because I'd like to quit for the day actually that's probably getting out of different TMUX shells.
Starting point is 00:29:06 So usually exit's like, I'm SSH'd into something, and usually it's exit to get out, and it's left on that machine, isn't it? I mean, wouldn't exit be there? It depends. If you launch a screen or a TMUX session in a remote SSH, you can set it up to detach to where it'll hang. But by default, if you exit enough times,
Starting point is 00:29:24 it'll close the ssh session and the shell will close as well so yeah mine are mostly git rspec mix ls cd and git x which is launching a git gui what are yours nick i was just curious My bash history got cleared and I don't have a handy, so I really don't know, but I'm going to roll with, um, you gotta make it make some guesses, some like informed guesses. Yeah. So mine are actually pretty similar. I've got a couple of custom aliases that I use pretty often, but it's funny that exit did make it on the eight spot. And it's so funny too,
Starting point is 00:30:01 because I have these mental reminders where you just need to hit control D to exit as well. Like you can do, that's like the same way to exit. And it's so much faster, but I have these mental reminders where you just need to hit control D to exit as well. Like you can do, that's like the same way to exit and it's so much faster, but yeah, I always type exit as well. I don't know why, but yeah, I've got like drafts is like a custom alias I created that helps me create like a draft blog post, but I've got like 800 draft blog posts, like for comparison, like there's a lot of them. So yeah, I run that a lot.
Starting point is 00:30:22 How many of those are published? Like 340 of them. That's, I run that a lot. How many of those are published? Like 340 of them. That's pretty good. You do publish quite often. I know many of us have way more drafts than we have published because we like to start a blog post, but finishing it is a lot more difficult. Yeah. So Vim is up here too in the top three, just because I'm running Vim dot Vim dot Vim dot
Starting point is 00:30:40 like all the time. Right. Adam, did you get the command ran well apparently it's a zsh thing or something else because what the command returns is no matches found zsh no matches found and then it passes the the regex part of it which is like the 09 through 09 part of it so i think maybe something's not right with ZSH where it can't take this command properly. So I was googling when you asked that.
Starting point is 00:31:11 With no indication of solutions. So here we have an advertisement for using the standard bash that's installed on most systems. Although isn't ZSH default on macOS? I think they switched it. I think there's an escape hatch that you might be able to run.
Starting point is 00:31:25 Now, if you run bash space dash C and then put double quotes in and paste that whole command in there, then that'll run it through bash instead of ZShell. Nice. That's why I invited Nick, because he has that kind of knowledge. Say that again, Nick.
Starting point is 00:31:40 Can I try and do that right now? Yeah. So just run bash, like B-A-S-H, space, dash C. Live doing this in the podcast. We'll see if it makes it to the actual production. Space, and then put in double quotes, and then pop the command in, in the double quotes.
Starting point is 00:31:55 Like, surround them in quotes. Okay. Well, that says invalid command. For me. Maybe it's because there's some quotes already in there, too too which are just a single single quotes the double quotes it works did you do regular dash c or did you go dash dash c because you said dash dash c okay yeah it seems like maybe it's a said thing because said is actually said colon space one colon can't you just launch a bash prompt somehow can you just say like
Starting point is 00:32:23 bash that's not going to have my history though is it no like zsh history oh your bash history that's a really good point too because this would have this would be the same
Starting point is 00:32:32 as running bash and then now you're in a bash prompt but yeah your history is going to be empty yeah yeah I mean
Starting point is 00:32:36 what a bummer I know what I use I know what I use I can tell you he uses tree I'm like npm-ing things I'm brewing things I'm ssh-ing things
Starting point is 00:32:44 I'm dot dot-ing things I'm ls-ing things but I'm brewing things. I'm SSHing things. I'm dot dotting things. I'm LSing things, but I'm doing a VLL because I'm Cool J. That's pretty much it. Maybe a couple of Node things. I'm checking versions often, you know. Node-V. Which one do I got? What's going on with this? What's going on here? A lot of SSHing.
Starting point is 00:33:00 And as a matter of fact, I lied. It's not VI. I'm nanoing. Oh, that makes more sense. Sorry. So I'm nanoing. So if you listen to that when i said vi before just replace with nano and it will make so much more sense because i was like how is he getting out of vi but he can't get out of him it's the same exact thing nano is a bit simpler yeah like control c a few exits in my list here all right a lot of lot of gets, you know, get something, you know. Several alias type things. So Adam, I'm going to put you in the spot here.
Starting point is 00:33:29 How do you exit Nano? How do I exit Nano? I think it's Control X or Control C, I believe. Yep, you got it. It's X. Yeah. I think Nano actually displays it in the bottom of the UI while you have it open. Yeah.
Starting point is 00:33:42 Which is a very nice feature. You know, just show me what I'm doing here. Don't make it be like, because the screen doesn't change in Vim or VI. It's just very hard to grok what changed. Yeah. Anyways, you know, and then quit is pretty easy. Control Q, it's pretty easy. Well, we're trying to talk about cat.
Starting point is 00:34:00 It turns out none of us use cat. Well, I do use cat. The main times I will use cat is when i'm looking at say a markdown file or in the cases when i'm doing say nsh keygen yeah i might cat that and pipe that into the clipboard kind of thing pb copy kind of thing those are times i'm using cat primarily i'm not using it often yeah but you know if we're comparing cat to bat why wouldn't they do vat or something closer to the c because or zat you know because like just make my finger not move over what two keys
Starting point is 00:34:30 the c key is two keys away from the b key so because bat has a much better brand because it says it's cat with wings oh that's good okay that's why that's why they picked it okay that that's making more sense now so cat for for the uninitiated is short for concatenate, and it just prints files to standard out and will also concatenate multiple files, which one of the cool things that I have done that you may not know is it can actually concatenate multiple MP3 files
Starting point is 00:35:00 into a longer MP3 file. So let's imagine you have a couple of text files and you want to create a combination of them right one after the other this is very common for certificates where you'll take multiple certificates and a private key or whatever and you'll concatenate them all together into one new file so you like file one so you do cat file one file two and then you do the the caret or greater than caret to direct that instead of to standard out to direct it to this file which is the next argument to file two or file three
Starting point is 00:35:31 you can do that with mp3s and we'll actually concatenate them as if they're text files so if you want to just like splat a bunch together you can say cat mp3 one well one dot mp3 two dot mp3 and direct it to three.mp3, and it will work. You just listen to them, and it just starts the second one after the first one in the new file, which is pretty cool. That's a new way to get your changelog master feed. Yeah, there you go. Just concatenate all of it. Cat them all together. Go, go, go.
Starting point is 00:35:58 There you go. 24 hours of changelog master feed. That's very cool. I never knew that. You can also use the star operator with cat as well. If you have to match on a file pattern, you can just do something like, well, I've done this before in the past where I have my notes set up to where I have like 2021 dash and then zero seven dot TXT, like July 2021. But you can replace that zero seven with a star and then redirect with like greater than sign and like, you know, export out to like 2021. And now suddenly all my monthly notes got redirected out to a single file for like the
Starting point is 00:36:28 year 2021. Very cool. Yeah. Is there anything missing in cat? Like, do you ever use it? And you're like, I wish it did this. I mean, this is probably a good segue on what that actually does. But yeah, syntax highlighting is would be kind of nice instead of having to open Vim
Starting point is 00:36:42 up to get that. There you go. Yeah. So that's basically what BAT adds. So it's just like Cat, only it defaults syntax highlights as well as Git integration. So if you call BAT in a Git repo, it will show you the index of what's been plused and minused
Starting point is 00:36:59 since the last commit. So it'll also do that for you. And it shows line numbers and stuff. So it's really kind of a cat with focus on software development. Whereas, you know, if you're catting MP3 files together, you don't really want to see the syntax highlighting on the MP3s.
Starting point is 00:37:15 That's a great example of one where I could see myself aliasing cat to bat then. Like, I don't do it right now because it's one of those things where I kind of want the syntax highlighting, but it's like, is it good enough to install another tool? Maybe. Right. That's really the question that comes down to is like, how much work is this to adopt?
Starting point is 00:37:31 Do I have to then take it with me everywhere? Again, it would be a progressive enhancement because it doesn't syntax highlight on some other machine. You're just like, okay, don't care. Because it's just a nice to have anyways. Now here's where it gets interesting with these two. Because bat is not a one-for-one replacement for cat. And here's why. It defaults to piping into less.
Starting point is 00:37:54 So bat will be paged by default, whereas cat won't. So if you cat a JS file, a JavaScript file, it'll just spit out the entire thing, right? And what you'll see if it scrolls your terminal is just the end. Whereas with bat, it's going to syntax highlight it, which that's the feature. But then it's also going to send to less,
Starting point is 00:38:12 which is a pager. And so it's going to let you navigate that file. And so it kind of breaks API compatibility in that way. Yeah, I'm curious. Does it have a flag to disable the paging and just have it go all the way? It does have a flag to disable. So there's like a dash dash paging equals never.
Starting point is 00:38:27 You can set that in your, there's a configuration file. There's also a shorthand, which I don't know what it is. You can also alias cat to bat dash dash paging equals never. So you can make it as part of your alias so that it doesn't do that. But then it's also kind of smart insofar as if you're using it to concatenate files versus display them, it will turn it off automatically. Like it obviously won't go to a pager.
Starting point is 00:38:51 So if you're catting files together the way you're talking about with multiple text files, it'll work just like cat. But when it comes time to print them to standard out is when the pager is in there. So you can turn it off. But I think if it was my choice, I'd probably say, well, you can turn it on. You know, if you want
Starting point is 00:39:08 to just page, go ahead and turn this on. But, you know, the author of Bat must have thought that that was a big enough feature for them that it'd be worth breaking that compatibility. You just need a BatRC file. Yeah, and then you've got to ship that BatRC file around or something. You know? Well, at least in your main machine you've got
Starting point is 00:39:24 it covered, you know? Yeah. I guess in your main machine, you got it covered, you know? Yeah. If you're hopping around, I guess if you're hopping around, that's the question too. I guess most people don't hop around to machines often. Maybe they do. I guess if you're a developer, maybe the reason you're using these modern Unix tools, you want the developer-y things of them. So maybe you are. I guess I jump around to a lot of machines, but I'm not doing sophisticated things.
Starting point is 00:39:43 I guess it kind of depends right like most things if you're taking these things with you because I'm not I'm mostly SSHing into Raspberry Pis and the occasional Mac Mini you know it's about it for me I'm not really doing a lot of Linux server management myself personally
Starting point is 00:39:58 yeah yeah I mean in that regard I try to set up my servers so that I don't have to SSH into them you know? And if I do, it's like, yeah, very one-off things like, oh, go through this engine X-Log and grep a couple things out. Yeah. So, I mean, if you're tricking your personal, you know, for lack of better terms, PC out, then trick away. And don't take the tools with you or don't feel like you have to.
Starting point is 00:40:22 But, you know, Jared, a long time ago, you said, I think we were, this must have been like four years ago, we were both upgrading operating systems at the same time, having to be getting like new machines, same timeframe. And I think you did just before me, and you were like, you know what? I'm not installing any extra stuff on this machine. I'm going to keep it pristine. I'm using Terminal.
Starting point is 00:40:38 And ever since then, I've been using Terminal. Whereas before I was an iTerm user, I guess just because, not because it was better, but like Term terminal's good enough and ever since then I've been using just simply terminal so I can kind of appreciate the minimalist approach to these things and that's kind of the
Starting point is 00:40:53 why cat versus bat, why bat over cat, would you install it, should you install it yeah, the other thing you can do is install it but not alias it so then you can just kind of use them both side by side and maybe when you want the syntax highlighting, you just have to remember to type bat.
Starting point is 00:41:08 Now I'm the kind of person I will never remember I have it installed and I'll just type cat and I just will see it the old school way. But if you are actually actively trying out the new one for a while and you want to run it side by side, none of these are like install them
Starting point is 00:41:20 and it replaces your cat with bat. That's not how it works, right? So that's nice is you can kind of limp in that way. I am a fan of only installing what you use. And I do appreciate a purge every once in a while. I'm excited to upgrade my laptop because it's getting long in the tooth again. And I'm going to do it again. I'm going to start fresh.
Starting point is 00:41:38 I'm just going to like, you know, it's like survivor for software. You know, who's going to cut the muscle? Who's not going to get voted off the island? So what's your top one that you're probably going to get rid of? Well, that's the thing is I'm going to get rid of everything and I only install what I need. Well, I guess I should say, who's coming back on season two?
Starting point is 00:41:55 Who's coming back? Good question. Tmux is coming back. Git, obviously. What else is coming? I do have my.files. I'll move them over. So it's not like I'm getting rid of all aliases.
Starting point is 00:42:08 It's mostly like desktop apps and command line tools that you have to install with Homebrew and whatnot. So yeah, all the typical things will be there. I'm sure I'll need Postgres right away. I'm sure I'm going to need Elixir right away. Like everything to run changelog.com, you know, software development. Maybe I'll just leave VS Code off this time.
Starting point is 00:42:26 I'm getting ready to just go back to Vim 100% because VS Code's just been slowing down on me lately. Really? Not me! And they kind of annoyed me with the, what's it called? That mode, restricted mode? Not sure if you guys have gotten that yet.
Starting point is 00:42:42 Is that what they do, a pop-up where it's like, hey, by the way, do you trust the files in this directory? And there's like a yes, no button or something? Yes, and it's new. It's like in a newer version, so I update it. And all of a sudden I have to trust all my own directories. And the reasoning is it's for security, but it has to do more with collaboration.
Starting point is 00:42:58 So you can securely view other people's files, but not be afraid that they're going to execute something, maybe in that shared mode or whatever. And these are things I just never use. And so for me, it was like offensive. Like this is the same folder I've been working with my entire life. And all of a sudden I have to tell you that I trust it. Like you trusted it yesterday. Yeah. So I got kind of bugged. I didn't understand that really. I was like, of course I trust it. And so I was like, yes. Yeah. So imagine that there's a new version of LS where every time you run it,
Starting point is 00:43:25 it's like, by the way, are you sure you want to view the contents of this directory? Exactly. That kind of perturbed me. And I was like, that plus it's kind of been running slower, like, you know,
Starting point is 00:43:34 things I'm waiting on it more. I'm like, sorry, VS Code, you're kind of pissing me off. You know, you might not be coming back next season. We'll see. We'll see. We'll see.
Starting point is 00:43:42 Well, there is NeoVim 0.5 just came out recently i saw that release now what's the skinny with neo vim why is everybody so excited about it's a performance thing or what is it so i use regular standard vim but neo vim 0.5 it was a couple years in the making and i think one of the biggest features as far as i know is the built-in lsp support so some of those nice things that you get from VS Code, like being able to do code complete with really nice IntelliSense,
Starting point is 00:44:09 that functionality now is something you get with NeoVim out of the box without having to run an external LSP server, as far as I know. It's now built into the editor as maybe a core plugin or something like that. Hmm. It may be time to dip back in and go full Vim
Starting point is 00:44:26 and give NeoVim a try and see if that cuts the muster. Well, let's move on to some more of these modern Unix tools. So we've got Cat and Bat. There you go, listener. Decide if you want to give Bat a shot. It's definitely cool. I mean, I think the syntax highlighting is nice, especially if you do a lot of catting of source code files.
Starting point is 00:44:44 FZF, this is one, Nick, that you put into the document. You want to tell us about that? Yeah, so this would be one, like if I were purging out all my tools, it would come back for season two, season three, all the way to season eight, and then the show would end. But yeah.
Starting point is 00:44:56 FZF would win. Okay, so if you're not using FZF and you are on the command line and you want to rerun commands that you've run in the past before, like your history file, it becomes very tedious to find these commands. Like, you can be one of those people who just hits the up arrow like 400 times in a row to try to find that command that you ran like six days ago, or you can hit Ctrl-R, and this will work without any plugins. You can
Starting point is 00:45:17 do it right now, and that is going to allow you to reverse search your history. So you can just start typing a command, like let's say you have a long git command or some, you know, whatever commands that you run, you can just start typing it first couple of characters. It is going to find a match. And if it doesn't find a match, you can just hit control R again to cycle through all these matches. So it's very, very handy for recalling commands that you've run in the past. And FCF takes it to another level because now it brings up a nice little menu that pops up where, and it starts to fuzzy find all of these, like basically every command in your history. So instead of just like having to start the command off as you run it, it's going to do a fuzzy match,
Starting point is 00:45:50 just like control P or I guess in VS code or whatever. If you're going to like try to open a file quickly, it's that, but for your bash history, where is he? I get something like that for free with all my ZSH. Do you? Does it pop up?
Starting point is 00:46:01 Can you see it? Like it's not as gooey like this, but you know, if I know the first few characters, let's say I'm doing a Geekman. I do GI or GIT even, and I just hit the up arrow. I'm going to cycle through, and I don't know if it's based on any sort of order, so it's not quite as sophisticated. And I do admit that FZF is more sophisticated, but it's kind of most of what I want. And if I'm typing mix a lot, for example, I just do MI and I up arrow until I find the server one, the get depths one, the whatever's. I don't remember those things in my brain.
Starting point is 00:46:36 Thankfully, it's kind of there for free with my ZSH. Yeah. Which is why I kind of like take that with me everywhere. Right. Yeah. I don't use ZShell personally, but that sounds like it's doing some type of like an autocomplete and it's showing you a preview of the command in like gray font, right? Or a color.
Starting point is 00:46:50 And then as you type it starts filling it up. No, it's just like just normal terminal. Okay. It's like you're just upping through them. It's like upping through your history, but your history is scoped to those first couple of characters. Based upon what you typed. Yeah, kind of. Yeah.
Starting point is 00:47:03 It's sort of delimiting based upon that. So I'm installing FZF as you speak, Nick, which means I missed the part where you talked about how I use it for my history. So if I just type FZF, it's like searching the files in my current folder. Right. So how do I use it for my history then?
Starting point is 00:47:17 I would say, did you go to the FZF get repo on GitHub? No, no, no. I just brew and installed FZF. I didn't have time for that. I also didn't have time to read the docs. I need you to explain to me right now. Right now, around this podcast. Go, Nick, go.
Starting point is 00:47:30 So I think the thing is, when I followed their instructions on the documentation, you may have to add something to your.rc file or zshell file to have that enabled. Gotcha. Okay, so FCF is more than just reverse searching your history because it can go through your files and directories too. But if you just do that in your home directory, you probably have, you know, tens of thousands of files in there.
Starting point is 00:47:49 So I would imagine that list got pretty filled up quickly. So it's kind of like an interactive replacement for grep. Is that a good way to describe it? It's a general purpose command line fuzzy finder. So, I mean, grep is a command line finder. Well, you might use grep to like grep through a file to filter out some content of a file like if you're looking for specific log entries or whatever this is more just like
Starting point is 00:48:10 show me commands I've run in the past without me having to type in like those you know the start of a command or whatever just like opening a file with a couple of characters you know like if you're opening up your mix.ex s file or something like that you can just type in like ix or something and hit enter yeah that's a bad example because it's such a short file name in the root of the project anyways but you get the idea sure sure sure yeah.exs file or something like that, you can just type in like ix or something and hit enter.
Starting point is 00:48:27 That's a bad example because it's such a short file name in the root of the project anyways, but you get the idea. Sure, sure, sure. So yeah, now I'm looking at their deal and it looks like you have to set up their fuzzy completion key bindings through Homebrew. So I will do that offline, but I am excited about this because you know what? Even just control R is not something I actively use
Starting point is 00:48:44 and not because I'm against it. It's because I don't remember it. What I do is lame. I do have history alias to H. So I can type H for history, right? And I can just pipe that into grep for a part of the thing that I remember and then hit enter and then there it was. Which is not cool. Even Ctrl-R is cooler than that, right? Yeah, also FCF works with Vim as well. So if you want to open files very quickly in Vim,
Starting point is 00:49:10 fuzzy matching them, then it's the same interface in Vim. And you can also use it in Vim for other stuff too, like searching your get commit and even Vim snippets because those are a little bit hard to remember. Yeah, it's pretty cool. It's like you can always remember a little bit of something, not the full thing, so. Right.
Starting point is 00:49:24 I think that's an interesting thing, too, because on the command line, right, there's so many commands to run, so many flags to run, so many flags and commands to remember. Yeah. Yeah. I like using the command line. I still feel like it's a very good interface to find things,
Starting point is 00:49:36 but sometimes, like, you know, I don't know, like psql's a great command to connect to a Postgres database and run some raw SQL or whatever you're doing in there, but sometimes GUI tools are just a little bit nicer. Mm-hmm. 100%. We talked a lot about LS. We didn't mention a specific modern replacement, so I'll do that
Starting point is 00:49:54 now. There's one called EXA and one called LSD, which is like LS with a D at the end. Both written in Rust, which a lot of these modern tools seem to be Rusty or Go-y,
Starting point is 00:50:10 if that's a word. But written in Rust or written in Go, like FCFs in Go, I believe. And these are written in Rust. Now, I just did a quick perusal of both of these tools. It seems like Exa is a little more advantaged with just features and more modern in terms of support, like maybe just a newer tool.
Starting point is 00:50:27 So I didn't look too much into LSD. But Exa is like LS, only similar to the way BAT does for CAT, Exa will use more colors. Now there is LS in color mode, like we talked about before. So you can have LS support colors, but Exa uses colors
Starting point is 00:50:45 i guess more fully to distinguish file types and metadata it also knows about symlinks extended attributes and it's get aware and then it's small fast and just one single binary but let's face it ls is also small fast and i assume it's a single binary that's a built-in exa does have tree view built in so there you go. If you install Exa, you don't need Tree because you got Tree for free right there inside that, which does feel a little more modern. You think like Tree would be
Starting point is 00:51:14 like a feature of LS if you thought about it, right? And other such things. So there you go. If you're interested in maybe LS on drugs, try LSD. It's actually deluxe. I'm glad you said that because I clicked through to it. It's not LSD. It's actually deluxe. I'm glad you said that because I clicked through to it. It's not LSD as you might think, Jared.
Starting point is 00:51:30 It's LS deluxe. So it's a bigger version of LS, essentially. There you go. The deluxe version that was never shipped. Or the EXA version. And I think this one is as much compatible insofar as you can directly alias it EXA to LS, and they think you'll be happy
Starting point is 00:51:45 i think it's smart to replace a given tool like ls for example but do it in a way that you sort of keep compatibility and additive like we've talked about i think that's a i'm not sure you know as you get on this list how often that's a hallmark of each of these but i'm hoping that's more of the case like it's common because if you do that then it's a hallmark of each of these, but I'm hoping that's more of the case. Like it's common because if you do that, then it's a lot easier to adopt because you're pretty much just able to alias it in the end. You know, I wonder how much that's an optimization point for the maintainers of these
Starting point is 00:52:16 projects. Yeah. It just seems like a net win if you get the new stuff and don't have to worry about learning new stuff. Yeah. Why would you not do that? Basically. don't have to worry about learning new stuff. Yeah, why would you not do that, basically? This episode is brought to you by Sentry.
Starting point is 00:52:43 Build better software faster. Diagnose, fix, and optimize the performance of your code. Sentry just shipped their SDK for Next.js. Now in your Next.js apps, you can capture errors, measure performance, manage releases, configure suspect commits, and automatically upload source maps to view unminified JavaScript and TypeScript with zero-ish configuration.
Starting point is 00:53:03 You get your events enriched with device data, breadcrumbs created for outgoing HTTP requests, release health for tracking crash for users and sessions, and automatic performance monitoring for both the client and the server. Check for a link in the show notes for details of this release. Best of all, our listeners get the team plan for free for three months. Head to Sentry.io and use the code THECHANGELOG when you sign up. Again, Sentry.io and use the code TheChangelog when you sign up. Again, Sentry.io and use the code TheChangelog.
Starting point is 00:53:41 So next up we have Man, good old man pages versus TLDR, which is probably the best name for a modern Unix tool out there. Definitely not a one-to-one replacement for man, but trying to do something slightly different. And this project admits that we all love man pages, but we don't actually love the contents of the man pages because many of them are old, not well written, bare bones, perhaps terse, don't have many examples. And TLDR is kind of a new take on an old idea, mostly focused around, hey, let's provide
Starting point is 00:54:20 some examples. I think they actually use tar as the one that says, well, what if we just showed you a bunch of ways you can use TAR and what that does? That's better than reading through a man page, which I can definitely agree with. That being said, this is one where, I don't know, I've just been reading man pages for so long. Maybe it's Stockholm syndrome. I'm just okay with them. I can read a man page. And maybe it's better for people who haven't been initiated and subject to the pain of grokking man pages but I've just had that skill already. What about you, Nick? Yeah, I'm basically similar to you but when it comes to some of these commands, I do really like seeing examples
Starting point is 00:54:54 so usually for me it is like, let's say I want to recursively go through files of a specific file type to count words or something like that. So that's something I don't have memorized but I'll just Google for that one thing and typically find a Stack Overflow example with the exact syntax and flags and stuff for the find command. So yeah, I guess if TLDR were searchable
Starting point is 00:55:14 in that regard, that'd be kind of nice, but I can go either way on that one. And that's a good thing, is you can go either way because the old-fashioned man pages aren't going anywhere. They're long established. They're going to continue to be there they probably will not be updated or maintained very often of course it's up to each individual author of the tool or maintainer of the tool to maintain that man page and so some man pages are better than others you know people put more more or less
Starting point is 00:55:38 effort into their docs this tldr is a collaborative thing which cool. So it's not just going to be the maintainers of the project. It's going to be the community contributing examples. So in theory, that means it's going to be actively maintained and improved over time in practice. Latest commit 43 minutes ago, over 8,500 commits to the repo. So they're definitely working on it and keeping it up to date. So that's spectacular. Very cool.
Starting point is 00:56:07 That's interesting though. So when you run the command and search through it, is it actually doing like a network request out to somewhere or is it all installed locally? Like would you need to get a new build
Starting point is 00:56:18 to get the new information that's contributed by the community? Great question. I just ran tldr tar and it says local data is older than two weeks. that's contributed by the community? Great question. I just ran TLDR tar, and it says local data is older than two weeks. Use dash dash update to update it. So it sounds like it will cache locally,
Starting point is 00:56:33 probably the first time you run it, and then you have to manually go out and grab whatever's new. I don't think you have to update TLDR itself. It probably just has some sort of source for the information that it caches and grabs from. Yeah, it's a good way to go. Kind of a middle and grabs from. Yeah, that's a good way to go. Kind of a middle ground. Yeah, I think that's a good way to do it as well.
Starting point is 00:56:49 So there you are. If man is not doing it for you, check out TLDR. Definitely practical examples is a great way to learn different command line tools. Next up, ping. All classic, ping. The old ICMP. What's the alternative one? Was it G ping or something like that?
Starting point is 00:57:08 Like the new one? Yep. Yeah, so I think this one's like, it depends on what you're using it for, right? So for me, typically when I'm running the regular ping commands, you know, I'm pinging some domain or whatever just to see if it's available
Starting point is 00:57:19 or to see what my latency is. Like, it's a very hard sell for me to use something like G ping for that use case because it's like, well, I can do ping, run it for two seconds, get the numbers, and I'm done. The graph is cool. It's awesome looking, but it's like, is it really helping me that much in my day-to-day? But then if I wanted to see a graph of
Starting point is 00:57:35 all the response times, then GPing I guess would be really cool, but I just don't have that use case personally. What about you guys? I'm the same way. It's more for me, like, is it responding? Is it responding? Yes, it is. How fast is it? That'm the same way. It's more for me like is it responding? Is it responding? Yes it is. How fast is it? That's it. I don't really personally care about the graph. I used to be more of a network administrator
Starting point is 00:57:52 back in the day where I was making sure certain servers were available and responding on time and I had to debug routing errors and stuff like that. And so then I would actually look at ping and pay attention to the round trip times and stuff like that. And so then I would actually look at ping and pay attention to the round-trip times and stuff like that.
Starting point is 00:58:08 And in that case, I needed more tools. And so there are other tools besides ping that you can get into and use. And I think GPing is definitely a step up in that regard if you're doing network administration or a lot of network troubleshooting. Maybe trying to see why your Raspberry Pi is so slow or usually it has to get outside of your local network
Starting point is 00:58:25 for things to really matter in terms of round-trip times. But back then, I definitely would have liked this tool. I rarely even use ping today, and when I do, it's just literally like, is this thing going to respond or not? It's almost like, is it there? Is it still at that IP address? Did it, for some reason, not get a new something from the DNS or something like that? I am running it side by side with a ping though on what is my
Starting point is 00:58:51 home server here and I don't think it's additive personally. And no knock against the software, it's just the graph isn't necessary. I think ping is good enough. Yeah, I think in a similar vein there's also dig versus dog where if you want to look at what IP address is associated to this A record or something, you can use Digg and get that information. Jared, does Dog do the same thing, but it's more colorized, I guess? As far as I can tell, that's the gist, because it's not providing any additional information. So if I just dig change.com, I'm getting back pretty much everything that dog...
Starting point is 00:59:30 So it's kind of just dig with colors. Right. Yeah, it's kind of in the same thing like ping with the graph. Right. It's cool, but it's like, am I going to install it? I don't know. Not to be negative or whatever, but... That being said, there's lots of options. There's lots of query options.
Starting point is 00:59:46 So maybe we're just looking at a face value and saying it's the same with colors. Maybe once you dig in, there's... Dig in. Pun not intended. Maybe there are more differentiations that we just don't see at surface level. So maybe worth a look. Also written in Rust,
Starting point is 01:00:01 so there we have a continuing theme here. I will give them a plus one on this, because we haven't said yet in the GIF on the repo, in the readme, is showing a ping of two different domains at the same time. That's not something that I think I can do with ping. Can you ping two different endpoints at the same time with ping and get the same results backwards as sort of just one resource. Because this is pinging Google and Facebook and sort of getting that graph with both.
Starting point is 01:00:31 That's cool. Now this is regular ping, it's just one address or one domain. Yeah, so it's single-threaded essentially. This is multi-threaded when it comes to endpoints to ping. It's basically the Tmux of ping. There you go. Or you could just use Tmux and then do ping twice.
Starting point is 01:00:50 There's a lot of ways to license it. Yeah, I do like that. So there's lots of these that are kind of in that same vein. There's a bunch of, by the way, kind of grep replacements. I mean, FCF is kind of that. We talked about that one specifically. There's also ACK, AG, RipGrep. This has been a competition on which one's the fastest,
Starting point is 01:01:11 less keystrokes. I always loved ACK's little tagline. Well, first of all, the domain was better than grep.com. But secondly, the tagline is like it's faster than grep because it's only three characters instead of four. So it's like 25 faster i don't know how it broke out but i always said that was kind of funny so we don't need to dig into those too much another one that i think probably lots of people are already using is jq not really a
Starting point is 01:01:34 replacement i mean a replacement functionality because you could use sed to basically like get into certain aspects of a json blob of text but it's not like set has any sort of JSON aware anything. That's been a big change over the last couple of decades is most people who are doing data interchange are basically parsing and sending JSON around the web, right? Yeah, so that one's really cool. So I've done a little like couple of one-liners where it's like you curl something,
Starting point is 01:02:01 like let's say maybe you're, I don't know, contacting GitHub's API, do a curl response there and get back that JSON result, pipe it into JQ, and then you can just, yeah, you basically just read the JSON with JQ. Like if you want to get, you know, user.repos.whateverwhatever, you know, it's like an object-oriented way
Starting point is 01:02:16 to access your JSON, which is way, way easier to parse than using something like ReproSet or whatever. Yeah, and JQ is pretty ubiquitous at this point. See it all the time. I see it in a lot of people's tutorials or in their readmes showing how to use their API. They'll often have JQ, and so I don't think we're necessarily breaking news
Starting point is 01:02:35 on this one except to say that there really wasn't a modern Unix tool specifically for JSON just because JSON is more of a modern format that didn't exist back when these tools were written. So JQ has placed itself. Now there are alternatives to JQ, which aren't on this repo. We can get into that at some other point. There's people who are trying to provide different ways of slicing and dicing JSON. So on a similar vein, there is an alternative to
Starting point is 01:03:03 curl. And there's lots of alternatives to curl. Of course, we know Wget, but that's not a modern alternative. Those two go back. More modern than those is HTTPIE. And that's just a very stark, less verbose way of requesting HTTP resources. And that's been around for a little while. What's newer and I think more interesting from that is this project, which I actually didn't know anything about
Starting point is 01:03:31 until I hit this repo. The modern Unix repo is Curly. C-U-R-L-I-E. And Curly is an attempt to take what was cool about HTTPy, which is really a simplified HTTP client for the command line but doesn't provide very many of the facility I mean we all know how many things you can do with curl it's incredibly featureful and HTTPy didn't really have a lot of those things
Starting point is 01:03:59 so whenever you needed like slightly more functionality you'd have to abandon ship and go back to curl and curly is an attempt of kind of providing the best of both worlds. And so it gives you what they say, the power of curl and the ease of use of HTTP. The cool thing about that is it's actually just a front end for curl. So how do you get the power of curl? Well,
Starting point is 01:04:18 you don't re-implement it. You wrapper it. And so everything inside of Curly, every command that you come up with in Curly, you can actually pass it a flag that says, show me which command you're generating for curl. Which I thought that was a really cool way of like, kind of eventually just learning what it is
Starting point is 01:04:38 that it's generating for you. Maybe you decide I don't need this anymore because I've learned. So it's kind of cool that way. Definitely this is one that I would use. I did download it. I've been using it today. So it's kind of cool that way. Definitely this is one that I would use. I did download it. I've been using it today. And it's kind of one I think would stick with me
Starting point is 01:04:49 because I do like just the simplification of that command line, but still being able to reach under the covers when I need to. Yeah, I love that feature of just echoing out the actual raw command that it runs for curl. But I haven't heard of that one before. But yeah, I'm going to check that one out. So you're not replacing curl with it though, right? Or you are? Nope. You are calling are calling curl well not what i mean is like are you using
Starting point is 01:05:10 that instead of calling curl yourself so even if like normal daily uses you'd say curl this would you still do curly or would you do curl i'm going to start doing curly for a little while and see what i think basically yeah okay and remember that I am a basic curl user. I'm not an advanced curl user. Right. So mostly I'm looking at header, like the most advanced thing I do is like looking for redirects, looking at headers, you know, I'll take the output from curl, redirect it into a file so I can, you know, inspect a file or something. Those are mostly what I'm doing with curl. And so I think this is like going to give me that pretty easily but we'll see yeah one more thing i do with curl pretty often is i forget the flags to do it but there's a way to just get the
Starting point is 01:05:51 status code back so like 200 or 500 or whatever you're looking for yeah totally so there's curly getting to the end here we have end thest versus envsubst. I don't know, Nick, you wrote that one down, so take it away. Yeah, so this one is not listed in the modern Unix directory there. Oh, you're cheating. But envsubstitute is a way for you to take, let's say, I don't know, an Nginx config file, or basically any config file that doesn't have the ability to do templating in it. And what you can do with env substitute is write out, let's say your nginx config or a Kubernetes
Starting point is 01:06:32 YAML file or whatever you happen to be using, put in like the shell style environment variables like dollar and then, you know, whatever the environment variable is, and then pipe it into env substitute and it'll go and take any set environment variables that you have, and then update the config file, and then spit that out at its output. So it's basically a way for you to template out config files that don't support templating naturally. That's a cool thing.
Starting point is 01:06:56 So what is a typical use case of that? Obviously, some sort of production deploy is where it makes sense to me, but give us a few hooks. Okay, so I just used this a couple of days ago where I was spinning up a Kubernetes cluster on AWS. And there's a lot of ways to do this one. And I just wanted to get the cluster up quickly. And AWS has this tool called EKS CTL. It's a way for you to define, I don't know, maybe like 10 or 15 lines of YAML. And that'll just spin up the whole cluster with parameters that you define. And I'm making this cluster to do client work, but I'm running this test cluster on my own
Starting point is 01:07:29 personal AWS account. And there are certain variables of this cluster that I want to be different. Like, for example, when I set it up on my personal account, I want to be on US East 1, but my clients are on US West 2. So the region of the cluster needs to change. So that's like one variable. And then other things too, like they want to spin up like 15 servers or like beefy ones, but I just want to throw up a
Starting point is 01:07:49 couple just to like see if things work. So basically like long story short, there's like four or five things in this one config file that I want to change between my environment and their environment. And I didn't want to have to duplicate two config files that are basically the same, except for just like two or three or four different variables. So in this case, now I just have a dot env file in the directory, I define my versions that I want to use like us east one, but like a couple, you know, T two smalls or whatever. And then I just pipe it through env substitute. And then you can pipe that into the EKS CTL command, like it supports that. So then it's like, I can just pop in my dynamic config file. And like, it doesn't support that naturally. But now it does with ENV substitute.
Starting point is 01:08:26 That's really cool. I think a lot of times you rely on kind of your target platform or your runtime that you're running to support templating, right? And a lot of them do it differently or don't do it at all. Okay, it makes the most sense
Starting point is 01:08:40 for when they don't support it at all, but almost kind of provides a decoupled way of doing it. Even if there are templating supported inside some of these tools that you're using together you have like this standardized way that you do it and inject those in regardless of what's natally supported is that am i on point like could you use it that way as well yeah totally but there is one catch you with this one so when you're dealing with environment variables on the shell, you can do like dollar sign, blah, blah, blah. And then you can do colon dash,
Starting point is 01:09:09 and then you can supply default value for that environment variable. So if that environment variable isn't set in your shell at all, then it's going to fall back to this default value. And ENV substitute doesn't support that. So like any environment variable that you plan to run through this program needs to be set on your terminal. So you'd have to do like export foo or whatever, and then give it some value. So I wrote this one down in the notes because there is another tool called ENV substitute. It's like the same exact name, but it was rewritten in Go and it supports that idea of having a default
Starting point is 01:09:39 variables in there. So you don't need to set them all up. You can just set a reasonable default in the config and then it works for, you know, however you want. And then you can optionally override that with your own environment variables. Very cool. So that's why you have ENV subs versus ENV subs. I didn't see it in the parentheses. It says go version. I thought, I thought they're both go. Okay. So this command ENV substitute, I think it should be built in. Like I didn't have to install it on Ubuntu. I'm not sure about macOS, but I'm pretty sure you probably have it. Yeah. News to me, TIL. That's cool. I don't think I can find some uses install it on Ubuntu. I'm not sure about macOS, but I'm pretty sure you probably have it. Yeah. News to me, TIL.
Starting point is 01:10:07 That's cool. I don't think I can find some uses for that in my life. Yeah, and you can just very easily try it out on your own. You can just use the echo command and echo out an environment variable and then pipe it into env substitute, no arguments, and you can just see how it works. It looks like it is here on macOS by default. So the play-by-play would be like uh export space hello equals world okay gotcha and then echo dollar sign capital hello and then pipe that into envs sp or env
Starting point is 01:10:37 sub st env sub st or if you want to get fancy, tap complete the command. Oh, do I need any sort of quotes? It didn't echo anything. Did you export the variable first? Oh, I exported it on the same command line. I should export it and then run the echo. Dork. Yeah, two separate commands. Yeah.
Starting point is 01:11:01 Tab completion for the win this time. Hey, it says world nice so cool but I mean you don't need to do this one live but the idea now
Starting point is 01:11:10 is like you can just take a file and then just pipe that through there and then send it over to whatever you need to
Starting point is 01:11:16 and it's going to like be the man in the middle that processes the file and turns it into a template that the tool understands
Starting point is 01:11:20 very neat well we've come to the end of the show we haven't come to the end of the modern Unix tools. So definitely check out the repo. All the little things
Starting point is 01:11:30 that we've mentioned will be linked up, including this ENV substitute with the Go version. So you can get that one if you're into defaults, which I certainly am. And I agree, should probably be built in by default anyhow.
Starting point is 01:11:46 But nonetheless, there it is. Oh, hold on. Sorry on sorry to interrupt but here's like I don't know a pro tip or whatever but if you are on the command line and you tried out the command that jira just ran if you did define a default for that variable it is going to work but the only reason it's working is because your shell is actually interpreting that default variable so it's a very tricky subtle thing so it's not going to work if you have the variable in a file but it will work in the command line because your shell is actually interpreting that default variable. So it's a very tricky, subtle thing. So it's not going to work if you have the variable in a file, but it will work in the command line because your shell is pretty awesome. That's the worst when you have something like that, where you're like, it's working right here in my shell. Why doesn't it work when I go to use it? You know? Yeah. Good pro tip. Yeah. Anything left unsaid? Surely you've left some things unsaid,
Starting point is 01:12:19 but anything else you want to say before we tail off? Nick, tell folks where they can check you out, the coursework you do, etc. Yeah, so I have a personal blog at nickgenitakis.com. N-I-C-K-J-A-N-E-T-A-K-I-S. And I put out a new post every week. A lot of them are YouTube videos lately, but I do have written versions of most of those. Like, you know, if there's a command line heavy video, you're going to see reference tables of the commands there.
Starting point is 01:12:42 As for courses, I have a Build a SaaS app with Flask course, where we build a SaaS app with Flask and use Stripe and a whole bunch of different stuff there. I have an intro to Docker course, dive into Docker. I keep that one up to date basically for new to Docker, want to figure it out, there's that. And there's also like the runninginproduction.com podcast, where, yeah, we went over that one before. Basically just talk to new folks every week about how they're building
Starting point is 01:13:01 and running their stuff in production. New courses on the way. I do have a deployment course coming out. Still working on it, but it's not available yet. But if you go to nickgenotakis.com, you can get notified there and when it ships. That's about it. I'm also on Twitter at nickgenotakis. All the places.
Starting point is 01:13:15 Everywhere. All the places. We do link it up in the show notes so you can find everything Nick just said pretty much there. We'll do our best to do great jobs. Hey, but guess what? They're also open source. So if you see that we've missed something, well, then you can step in. And if it's October, you get a t-shirt.
Starting point is 01:13:32 Not from us, from DigitalOcean. That's right, from DigitalOcean. Nick, you're always awesome. Big fan of what you do. Thanks for coming on the show, man. Thank you for sharing your thoughts, your wisdom, et cetera. Yeah, thanks a lot for having me. And this is really fun. All right. That's it for this episode of the change log. Thank you for
Starting point is 01:13:50 tuning in. We have a bunch of podcasts for you at changelog.com. You should check out, subscribe to the master feed, get them all at changelog.com slash master, get everything we ship in a single feed. And I want to personally invite you to join the community at changelog.com slash community. It's free to join. Come hang with us in Slack. There are no imposters and everyone is welcome. Huge thanks again to our partners,
Starting point is 01:14:13 Linode, Fastly, and LaunchDarkly. Also thanks to Breakmaster Cylinder for making all of our awesome beats. That's it for this week. We'll see you next week. Game on.

There aren't comments yet for this episode. Click on any sentence in the transcript to leave a comment.