 Today we answer the most important question in Linux and I don't I unix based operating systems, whatever Here's the deal guys. There are a lot of people who watch the channel a new new users new friends Who see stuff going on and they don't often know why we do the things we do? So in this video, I want to respond. I want to respond to a little comment That's representative of many comments that I get on my channel This guy actually posted this comment on a video I did on graph if you don't know what graph is It's a document compilation. It's a built-in document comp elate compilation Program that is on unix based operating systems It's not important for this video, but it's it's a universal question that actually touches on many important things So anyway, he asks I'm really new to Linux. So could you tell me why this is an advantage over something like a? GUI text editor a graphical user-intered face text editor like for example Microsoft Word Libre Office Basically the same thing you mentioned something about Extensibility forgive my inner ignorance lol that's total zoomer thing ending in sentence with lol or haha with no period That's classic anyway So why why do we not use on this channel Libre Office or Microsoft Word? Why do we insist on doing things in text files in the case of graph again graph you write something In a text file with little markup showing what is supposed to be bold once what's supposed to be a header And then you compile it into a PDF. Why would we ever do that in a text file? Why why can't someone just write a GUI interface a graphical user interface for that? Well, the answer is well the answer is simple, but you sort of have to be shown it You can't be sometimes you can't be explained it. Let's put it this way You know first off, you know if you do something this doesn't just apply to document compilation I'm gonna be clear. This is a universal fact of the Unix philosophy. Okay, we like extensibility Whatever this but buzzword means It extensibility is actually a classic buzzword But anyway, but I am gonna go just as an example So I have a directory here where I have all of my Assignments that I did in college and and the season and you know papers and stuff like that Specifically actually first let's go. I have a thesis right here. So my thesis. I didn't do my thesis in a graph I actually did it in law tech. So all of this jumble jumbly stuff here This is actually my thesis. You can see the text here. You can see there's markup So it's showing you what is supposed to be italic and things like that It is automatically citing things that actually automatically produces Citations and stuff, but what is the advantage of doing stuff in a text document? So just to be clear first off, this is gonna be compiled into something that looks like this Okay, so this is what it ends up looking like, but why should we do this in text? Well, here are some things just just to prime your brain. Here are some kind of things you can do with text for example, maybe I want to know did I talk about Spanish in my My thesis I don't know did I well I can actually just instead of even opening the file I can actually just search for the word Spanish using the command grep, okay? So for example, I could search for that and that actually gives me it gives me every single line that has the word Spanish in it Spanish is nice and highlighted here or let's say Let's say I want the words only okay I can actually take the words only and I can count them up in WC and that will actually give me Okay, 17 you mentioned Spanish 17 times in this document or other things you can do with text documents Let's see something else. I know there's some people who are very anal They think that you should not refer to Spanish as Spanish You think that they they think that you should refer to it as Castilian or something like that So another thing we could do is we could run a said substitute command and we could replace Spanish Every instance of Spanish with Castilian. I think that's how you spell it in English I'm not quite sure but anyway, you could replace every instance of course to do that You would run it with the eye option, but I don't actually want to replace it instead I'll just grep out the results so that we can see that in each case all the times that we had Spanish now they've all been replaced with Castilian. Okay, that's that's one little thing you could do or I mean There's more stuff you could do let's say Let's say somewhere if I'm just in my classes archive here I want to look I remember there were some there's some little paper that I wrote about Bengali the language Bengali I could do something like this I could grep for Bengali now the eye option here happens to be searched for case and sensitive So if it's capital or not or if it's all capital or no capital And I'm gonna search recursively through all these folders and I'm also getting the capital eye option That's so it ignores binary files. It ignores PDFs and stuff like that I'm gonna search everything here and it actually shows me okay here are all the situations where the word Bengali is used Actually, let's let's clean that up. Let's only use the word itself. So now we basically get a list of all these files Oh, the one I was looking for is this one. It's this paper that I wrote on You know how scope is tied in the the scope rules are tied into porosity rules and stuff like that So I can actually look that document up So you're just seeing very superficial things. So I'm replacing stuff with said I'm looking for things with grep but the thing to remember about text files is none of this you can do with with Microsoft Word unless you open up the document and you go into Microsoft's Designed user interface and one of the options happens to be there Whereas if you're just using plain text if you're abiding by the Unix philosophy You actually can do much much more because any program can look at text all of these commands that we're looking at, you know said grep Tr All all of these programs can actually just run on text So they get you can get stuff from them and do stuff with them Now it's not just me running things on the command line mind you This could also be like anything you run on the command line. You can also automate So for example, I can easily automate commands that I run here Or I could you know, I did a second ago This thing to replace If I if I ran this command it would replace every instance of Spanish with Castilian I could actually run that on all the files in this directory if I wanted to massively update You know a bunch of files at the same time Or I could have rules more complex than just a simple replace or stuff like that So when you're doing that now all of this might might be gobbly gook if you're new to Linux I don't know anything about these programs I don't know anything about grep or set or all these scary words that don't even sound like English words But the issue is once you once you take those first steps once you realize that you can do stuff like this You realize there's a massive world out there of not just command line programs you can run But also, you know being edit able to edit something in Vim. Okay Vim is one of the most powerful I mean not just them. I mean the important thing is there's no individual pro program that makes editing makes editing text good But so many programs have different abilities. So for example in Vim I have A couple scripts that I have built to interface with it. For example, I have this thing here. This is a compiling a compiler script Where if I'm in a law tech document If I run What is it comma c if I run comma c it runs this script right here? Actually, there's an error here The packages aren't up to date, but that's not important But normally if I if I run Uh This compiler script it will compile either a law tech document or you know a markdown document It might even compile a program or something like that. Um, you can actually build scripts into your Into Vim into your text editor into the thing that you're modifying stuff by or the same way I have another thing that's like a op output and this is like, okay Well, this opens up the output of this file. So this is the pdf file it compiles to I guess that error wasn't that fatal Or something like that because it's still produced this stuff. But anyway, um, so that's the kind of thing like when you're doing This is what extensible means. That's what i'm getting at When you're dealing with text you're dealing with something that's extensible It's not just something that you have to use with microsoft word It's something you could use with any command line program You could actually edit text with microsoft word if you're suicidal like a plain text file Um, you could log into a server With ssh and modify something and you might be saying, I don't know what any of this stuff is I don't know. It's scary. There's a scary hacker stuff. I don't know anything about it But the thing is once you start taking taking those baby steps, you realize this world is much easier to live in You can much easier Easierly make a uh an extensible work environment that just sort of it's not even something you work on It just comes from the fact that oh, I want to do this a little bit more efficiently Oh, I want to be able to script this. I want to be able to automatically change all this kind of stuff I mean, I do stuff really radical in vim. I mean, I uh, let's say Uh, let's see. What's a good one? Let's oh, let's just go to No, we'll do the hermetic corpus. Okay. So for example, I have um, uh, I I've been doing like bi-glottic Texts of you know, I want to in la tech produce. Uh, let's say I have uh, let's Use that. Yeah, so this thing you have here is actually a bi-glottic text if I compile this document Let me actually open up that so you can actually see it. Okay. So This is what this looks like. All right. So on one side I have greek text and on the other side I have english text All right, that's something that I do here and how that actually works out is um, All I originally just copied a text, you know The greek text and the english text and I automated putting them in the correct Uh order in vim like taking the paragraphs and interspersing them all of this I did mostly automatically It needs some manual oversight, but in general it's something very easy to do You cannot automate this kind of stuff in microsoft word It's forget about it forget about even if you have some cool looking Uh, I don't know even in groff well, you know, of course you can't modify groff compiled forms But you can operate on groff text. Okay, and that's the important thing So you can do magical things like this took me I was driving, you know, 331 pages of this like constant bi-glottic text I want to say I did that in a series of hours and that was just uh, I was on a road trip And I was doing it in the back of the car It you just needed the manual oversight vim actually does most of it You can just program macros into vim that do it all magically by itself. Okay So anyway, even more than that actually there's another comment. I got I got this a couple years ago too And it was someone actually explaining why writing things in text is so much better Why abiding by the unix philosophy is so much better I actually remembered this post from two years ago and when I thought when I saw this comment I remembered it So this guy was responding to someone who I think was commenting on a video that I did on beamer Which is like a la tech way of compiling Or maybe it was our markdown presentations But it was some kind of way of compiling a text file into a slideshow Which is very easy to do And he says what he said about microsoft powerpoint all applies the Libre office and press Impressed to there are other advantages which I consider way more important. It's text You are virtually guaranteed to always have access to your past data Good luck trying to get access to your Libre office and press presentation in 30 years Or your microsoft powerpoint presentation in 20 years It's text. You can manage it with git. It's text. You can look at diffs You might not even know what a diff is, but you're gonna want to know It's text. You can use the power of your text editor for example to make regex replacements I'll try doing that in word. You can use scripts to manipulate the content You can find files by their content. It takes up very little storage like all this kind of stuff That is what extensibility means. It means you don't have to use One file in one particular way. You have a huge toolbox of tools that can do All I mean you can you can even nitpick over which is the most efficient way to modify a file Should I use vim? Should I use the said command? Either way you have those options You don't have those options with microsoft word microsoft word is going to be constantly changing not just microsoft word anything else it like Um, uh, you know Video editors that are hard to modify just any kind of file format that is that is Further and further away from text. It is harder and harder to do stuff with and that is why you have to keep Things like this simple because it makes it makes your life simpler if your your format is simpler that you're using That's why we do it. We don't do it contrary to popular belief a lot of people come on this channel You just do that to look to look cool like a cool hipster hacker, man Like people come to you people come to you and they're like, oh, I think you look cool So you must be doing it to look cool Which is total nonsense if this did not make my life way easier I would not be doing any of this crap. I mean it looks Again, I could open up my thesis like the the source file looks scary Oh, no, they're a bunch of headers and stuff that you know, I don't know how they work But the thing is like this is it is so much easier It is so much easier to be able to do this in pure text be able to modify any of it Oh, and guess what law tech it also has the ability since it's building off of simple format. It does your uh references automatically It does like all of this kind of stuff automatically. You don't have to worry about it Like, you know, I I have never seen a bibliography in my life I I never have to do one of those ever again because all of this kind of stuff It's it's done automatically. All right. So anyway, hopefully this is getting through to you That there's a reason that we do what we do Extensibility it's it's not a meme it is a meme, but it's not a meme meme You know what? I mean, it's it's a meme because it's real It's not like one of those. Oh, it's just a meme people do it. No like This is why we do what we do. Okay. All right So hopefully that makes it clear to some people just get your toes in this kind of stuff You can look at my watch my old videos on everything You'll you'll get it. You'll get the gestalt of what you're supposed to figure out. All right. That's about it. See you guys next time