 Why is all of our applications being rewritten in Rust? It seems like the Rust programming language has become the latest meme. Everybody wants to rewrite all the GNU Core Utils in Rust. People have even suggested rewriting the Linux kernel in Rust. So what's the deal with Rust? I don't know, I'm not a programmer, but I can tell you this. Rust and especially these Rust applications people are writing are definitely not memes because many of these Rust replacements are actually better than the original applications. Today I wanted to highlight a few programs that are available on Linux that are written in Rust that I think you guys should know about and probably should have installed. So let me switch over to my desktop and I'm going to open up a terminal. Let me zoom in. All the programs I'm going to show you today are actually terminal applications. Most of them are command line applications because that seems to be where most people are focusing their attention. A lot of people are learning Rust and when you're first learning Rust, you want to put it in action. And the easiest thing to do is rewrite some basic command line utilities like some of the GNU Core Utils. You know, rewrite them in Rust. Actually, before I even get started on some of that, I actually forgot the prompt I am using. The shell prompt here in the fish shell, this is the Starship prompt. Now the Starship prompt is available in the Bash shell, ZSH and Fish. And the Starship prompt is actually written in Rust. So if I did a CD, let me CD into my wallpapers directory. You can see the Starship prompt gives me some get information and it's quite customizable. You can configure the Starship prompt to show you a variety of information. So that's already one Rust program. But let's start with some of the rewritten core utilities. So everybody knows the standard LS command in your shell. And a lot of people always ask me about my LS command because when I run LS, of course, it looks very, very different, right? I've got, you know, the file permissions, the user, the group, the date, of course, and then the file name. And it's very colorful and each column of the permissions, the read, write, execute permissions has a different color. And it's a lot of people ask me, hey, how do you get LS to look like that? Well, that's not actually LS. That is actually a program called EXA. EXA is a Rust replacement program for the standard LS command. If I ran EXA, you know, this is what EXA looks like without any flags. Typically, I give it a whole bunch of flags. I think it accepts the L and the A flags just like LS. So that's EXA with the dash LA flags. I also add a few other options to it. I have it group the directories before the falls and a lot of other things. And then I just simply created an alias in my shell config file so that LS actually is just the EXA command with my preferred flags. Let me clear the screen there. So Starship and EXA, and both of those are very easy to get and to install Starship. For those of you that want the Starship prompt, again, it's available for Bash, ZSH and Fish. And for those of you that are on Arch, I believe Starship prompt is available in the AUR. For those of you that want to install EXA, EXA I believe is also available in the AUR. Or you can always install it with cargo, which is the Rust package manager, if you will. Just do a cargo install EXA. The next Rust program I want to talk about is a pretty common one most of you guys know about. It's BAT. BAT is like cat, but it's rewritten in Rust. So it's basically somebody wanted to practice, you know, learning how to program in Rust. So what they did is they just rewrote the cat command. So let me do cat so you guys can see cat on my Bash RC here. You just, you know, spits out everything that is in my Bash RC. It spits out all the lines. It just, you know, outputs everything in the file. Now let me run that same command. It's a let's do a BAT dot Bash RC. And you see this is a much better version of cat. So not only has it been rewritten in a different programming language, they actually added some really neat functionalities such as the line numbers. They also added, of course, syntax highlighting. The other neat thing about BAT as opposed to cat, when I catted my Bash RC, of course it spit the whole thing out and we ended up at the very end of the lengthy Bash RC file. Here, BAT actually starts at the top of the file, right? And you just go down by hitting the spacebar. Very similar to how you do with the standard less command in the shell. And of course, queued to quit out of BAT. So BAT is a really, really neat cat replacement. And quite frankly, I don't see why everybody just wouldn't replace cat with BAT. As a matter of fact, I probably would just create an alias. So anytime I want to invoke the cat command, I would probably just use BAT instead. Another GNU core util that's been rewritten in Rust is the standard grip command. Well, in Rust, we have RIPGRIP. So RIPGRIP, I believe is available in the standard arch repositories, or it may be a AUR package. I can't remember. But to run RIPGRIP after you have it installed is RG. So just do an RG and then do a search for something. I'll just go with the suggestion here. So I'm going to search for the word alias in my Bash RC, because I know my Bash RC has many lines that include the word alias, of course. And of course, it just spits them out. And the really cool thing about RIPGRIP is, by default, we didn't have to give it any flags or options. By default, RIPGRIP gives you the line numbers and it also gives you this highlighting. So it actually highlights the string that you were searching for. So for those of you that are not familiar with the RIPGRIP program, let me see if I can do a TLDR on RIPGRIP. It may not have a TLDR page. Does it have a man page for RIPGRIP? Just a standard man page. No, it doesn't. Does it have a dash dash help flag? It actually does not. Maybe I needed to do RG instead of RIPGRIP. Maybe that's where I would get the help information. Ah, there it is. RIPGRIP has a number of flags and options similar to the standard grip command. It just does some things better. It has some better defaults, of course, by already including the line numbers and the highlighting of the search term. You're going to find that actually with a lot of these REST programs. They typically add syntax highlighting and coloring and things. I mean, we saw that with the BAT command. We saw that with the RIPGRIP command. Let's try the standard GNU find command. It's another core util. But if you don't like the standard find command, which has a ton of options and a ton of flags and can be kind of complicated to learn everything about the find command. Well, there is a REST replacement called FD. So let's do a find here in my home directory. And I know we have, of course, a bash RC file in my home directory. So let's just search for it. Nothing was returned. Well, let's just search for bash and see what gets returned. And this does a recursive search. So it basically does the find command recursively from my home directory. And it searches for the string bash. And it found several different things that had bash in the name. And of course, if you didn't want to search recursively in the directory you're in, of course, you could specify a directory. So I mean, I could search for something like, I could search for the string WGIT in the directory distrotube.com because I know that it's going to find something in that directory because I already saw it in the search results from the first command we ran. And there you go. We just did an FD and it found this file here that included the string WGIT and it searched in distrotube.com recursively. FD is a really neat replacement because, again, the find command, let me do a man on find and I'm going to page down. This is the man page for a new find, right? It's gigantic, right? And now let me see if does FD have a man page? Man FD and let me page down. One, two, three, four, five, six, seven. You know, seven times I had to page down instead of about 50. So it's a little simpler command. Much more intuitive, you know, as far as flags and options. Does it have a TLDR? TLDR and let's do FD and here's the TLDR for FD and it's very simple FD pattern and then the path to the directory is typically what you'd use. Of course, you can do some regex with it as well and you can also execute commands on the pattern you're searching for you as you can see FD pattern and then give it the exec flag command to run on all the search results return. So find this pattern. So find this pattern in this directory and all the files that have that pattern then I want you to run this command on it. That is a really powerful command and I certainly would have a use for that on occasion. Another neat Rust program is TOKE. At least I think that's how you pronounce it. T-O-K-E-I and this basically tells you for those of you that do any kind of programming and development or you're just curious about what kind of programming languages are in use in a directory. So we're in my home directory and when I run it in my home directory TOKE it just tells me all the files that are written in the various programming languages that it knows about. So that's what TOKE is. It's actually there's not much else to it. I mean, is there a man page for TOKE? There isn't but let me do dash dash help and see if that will give us some flags. Yeah, it has really just a handful of flags and options. Let me clear the screen here. One last Rust replacement program if you will. Everybody knows about the standard PS command for Linux so it'll give you all the processes. So if I did a PS then give it a dash aux here and we can take a look at everything. All the processes that are going on my system. Let me clear the screen. Well, there is a Rust replacement prox. Here is prox with no other arguments and it's very similar to like the cat command. Yeah, as far as, you know, if you want to view the whole thing just hit the spacebar, you know, it has that less kind of feel to it where you want to go down line by line. You could just hit the spacebar. Of course, the scroll wheel works as well. It also has the line numbers and this is just a nicer PS command, right? Prox is just a better command than PS and if you wanted to search, you really don't have to give it any flags or anything. I think I could just do, if I wanted to do prox and again, I know I'm running the alacrity terminal so I could look for that process running. I could look for a process called alacrity and you can give it a and or an or. For example, if I wanted to look for a process that included alacrity and the word fish because the fish shield is running in alacrity. How do I know that? Because I ran the command before. So this will look for all the processes that have alacrity and fish, you know, as part of the process name. If I wanted to do a or and then I would give it dash o for or and I could look for, you know, alacrity or system D because those will be separate processes. So there are several system D processes running and of course the one alacrity process, you know, this one terminal I have open at the moment. So those are seven or eight REST programs that I think are really neat. And I think all of you guys should check those out. Right. So what did we talk about today? We talked about the Starship Prompt, EXA, Bat, RipGrip, FD, Tokay and Prox. And if you guys don't have those programs installed, really install them. There's no reason not to install them. I know a lot of people are worried about blow and installing programs, especially programs written in languages. Maybe you don't have other programs written in languages already on your system. You're not heavily invested in a lot of these Rust applications. Get over that. Yes, it's going to install some stuff on your system, but most of these Rust libraries and all that it has to install are just really small programs anyway, really small things. It's not like it's going to take up a lot of drive space. So go ahead because really I think it will eventually get to the point where a lot of these Rust programs, even though they're kind of alternative programs at the moment, I can see a day very soon where most people are using, for example, RipGrip rather than Grip. That day is coming, so I really think you guys owe it to yourselves to start investigating these programs now. Before I go, I need to thank a few special people. I need to thank EBC, Dallas, Devin, Fran, Gabe, Corbinion, Mitchell, Akami, Arch 5530, Chris, Chuck, David, the other David, Donnie, Dylan, Gregory, Lewis, Paul, Big Vim, Scott, Wes, and Willie. They are the producers of the show without these guys this episode about whether Rust programs are really just a meme. This episode wouldn't have been possible with these guys. The show is also brought to you by each and every one of these ladies and gentlemen as well. These are all the people that support me over on Patreon because the Distro Tube channel is sponsored by the community. If you'd like to support my work, look for Distro Tube over on Patreon. Alright guys, peace. I wonder when Emacs will be rewritten in Rust.