 I'm Sergei Skavuto and this is going to be WP, CLI, and the command line. It's going to be a little bit the usual talk because I'm going to be on the command line just about the whole time and I actually need to set the talk up first because it is ran through a WP, CLI command that I forked. I'll talk about it in a little bit. So let's see what do we do first. This is a bash script that I set up that I will be talking about later. Actually, one second. This is the part that I did not set up earlier. If you don't have a server up, you're not going to have a server to work with. So this talk is going to be working off of a local vagrant machine, basically a virtual box that is not running. So I'm going to start it up right now. Take a second. And the intro will come after it's set up. So this script that I'm going to be running right now basically is going to, I'm setting what the host is with a flag. The host is going to be called new and I'm going to be installing WP, CLI, and core all at once, the WordPress. This is detecting that it is already installed WP, CLI, but I know on this server it's an older version, so I'm going to actually overwrite it. So that's downloading it there and setting up WordPress. This part is through WP, CLI. I'm starting kind of fast, but I'm going to go back to the actual slow and kind of easy beginning. A quick question actually. Who works on the command line commonly? All right. And who has never or barely ever used the command line? Excellent. And I know people that do use the command line WP, CLI, something that you use often? Enough? Okay. So this talk's going to be perfect because it's from beginning to end of the spectrum, basically. This command here is what installs WordPress. And if you see this one of 12 commands that you can input like actually for the database, database, username, password, et cetera. So I set up this script to kind of have preset or preconfigured parts, but I'll touch into that in a little bit. I'm going to just put the database name here. The user is backwards. And that just popped up the config already. This could all be scripted as one thing. If you wanted to have like A site all the time just to test on your computer, you could just have a script that just does it automatically without actually prompting you. But I have this set up because I often set up sites with different names or database credentials, et cetera. This is going to be my URL. And I'm going to call this site awesome. So you can put your username and password super secure. And my email. I'll just call it that. And that should be it there. And it pops up our new site. So that's already set and configured. This is the 2019 theme because we're all new, new school. And if we go to the admin, I can just log in. Thanks for that sound. That was perfect. That's the loads. So there we are. So now we go back here. And is anyone familiar with SSHing onto servers or not familiar, I should say? So SSHing onto a server basically is a transfer secure shell. And it's a way to connect remote like from here to that server. Now the server is within my own computer at this particular juncture. But it connects to the server and lets you use that command site, command prompt. So here you look at my command prompt now and it looks one way. And if I say SSH new, for all of this that has to be pre-configured like you have to have a configuration to your server already that you can connect to. Like FTP, you know how you have to get the credentials for that? Same type of idea. So now I'm there and you see it's a different command prompt, right? Because now I am on the server. And from here we need to install the WPCLI percent command, which is this little ditty here. That basically uses WPCLI to install a custom command, not a built-in command from a GitHub repo that I have. So now it's pulling that in and this is going to actually start the talk. I'm just kind of setting it up so you can see that how I set up WordPress. So that is that. And now we move to where WordPress is and start the talk. So this is running, this is basically this percent command. What it does is it parses markup, which is kind of the file type that you more often probably see on GitHub when you see like their readme files, et cetera. So this parses markup and it'll show it as this. Question, yes? No, I can't. Because some of the slides take up a good bit. Is that too small for you? Kind of blurry. Can we all see that? Kind of. Best I could do. Sorry. So, well, to start the talk, Sergius Cabuzzo here. Can you find me on Twitter at Ecotech. And ask, the question says who is this guy, right? Who is this yapper over here? I run Linux exclusively. I've been doing it for over 10, 20 years now, actually. And I've been doing a lot of sustainability work for over 15 years. I do a lot of water reclamation training and teaching and I've done natural building permaculture trainings, et cetera. Happy to talk to anyone about that. It's not the subject today, but I'm very, very passionate about that as well. This next one is actually kind of jumped the gun on this. I am actually not a WordPress core contributor. I have a patch that is going to get supposedly committed by 5.2. It's going to be awesome. And WPCLI, I did contribute some code a while back. I founded Ecotech.io. That's a WordPress maintenance site, like service that I have, which is mostly geared towards nonprofits and kind of helping them out to kind of bring up the sustainability system. And I brew things, lots of things. Also come later and ask me about what I brew and the fun things that we do. And you may have seen my VW bus out there for little things rusting up, but it's awesome. I love it. And it also turned me into a mechanic because they break all the time. So for people that don't use the command line too much, the command line is awesome, but it doesn't take any personers. Basically, you mistype something, you hit enter and you didn't see what you did and you just broke something. Something got erased, files are gone. So you always want to be careful. First thing I did with Windows 98, when I first found out about breaking things, I just had all these extra files that I know what they were doing. Deleted them all. Next thing you know, that was all my Windows files. No more Windows for me. Similar, but different problem. But be aware of what you're doing before you hit enter. Definitely try not to copy and paste things from the internet. Blindly, at least, because things can break. Even from this slide, these slides here, if you check later and you want to kind of test them out, some things may not work with your systems. Okay? So let's kind of get started with this. I'm going to start with the command line usage. It's just kind of the shell and what we do here. Yeah, go ahead. You may have already said this, but are the slides available? They will all be available. There's a link at the end to get them. Yeah, that's actually it. So why would you want to use the command line? This mileage may vary, but your friends will think you're the coolest. Some of my friends think I'm the coolest. I don't know if it's because of that, but let's just go with it. It's been around for a long time. The command line was preceded any kind of graphical interface. All these commands have been around since probably at least the 70s, or most of these commands at least. So there are just no bugs really to be dealt with on these. So they're pretty rock solid. And you can put commands. The cool thing about this is, you know, I'm going to show you some commands in the beginning pretty soon that, you know, show your directory or let you delete a file or do, you know, random things. That doesn't seem so exciting because who cares? You can just go to your window somewhere and click delete and be done with it. The magic about using the command line is that you can actually script these commands to do things all at once. You automate things in a way that a lot of people do with graphical interfaces. You know, like when you have plugins doing things for you with WordPress, that's just a script that does all these individual commands all at once. So if you want to spend the time and kind of learn to kind of do a little bit of scripting, it will end up saving a lot of time on repetitive tasks. Oh, that's actually my next thing. So yeah, so repetitive tasks. That's the trick about also using scripts is that you do want to make sure that these are repetitive tasks that you're doing on a script because otherwise you're spending an hour writing a script for a thing that you're going to do once and it takes you five minutes. So kind of you want to engage your things. Reasons to not use a command line. This is probably more true than the first one. Your friends will think you are a dork. At least most of mine do also. And it can also break things very easily. As I said, the commands are very rock solid, but our fingers maybe are not. I break things all the time. Even now you saw me kind of having a misconfiguration problem earlier. Things happen. So you want to be careful what you do. You usually want to test things on a test server such as this one or other stuff like that. And script writing, like I said, does a lot of things at once. It makes it even easier to break a lot of things at once. So things to be aware of. And I mentioned this earlier, but exactly that when you write, you know, you spend a lot of time writing. I've done some scripts even the ones that I'm going to show you right now that I don't really use that much. It's kind of a proof of concept, but sometimes you'll spend a lot of time with this awesome concept of a script. You write it and you use it once. And now you spend three hours again, like on something that takes two minutes to do. The flip side of that, of course, is that if you spend, you know, like day in and day out doing the same process all the time, you catch yourself doing these things. That's when you, it's a red flag to just go script it. You script this and then you just write one command, hit enter, and it just gets done. So it's a good bonus. This is a very, very low level of what the command line can do. These commands, you have PWD. There are people that never use the command line here, right? What's theirs? I've got a couple people, right? So when you're on the command line, I'll show these examples in a little bit, but you have like PWD is the command that you type and it shows you what directory you're in, because not like on your, you know, whatever Explorer window that you may have on a graphical interface it shows you the folders and everything and you see where you're at. The command line, you have a command line and where are you, what's happening, right? PWD and I'll show you what, where you're at. Make directory creates a directory. You have a CD which changes that directory. You can see these LS. So it's for list directory. Cat is a concatenation. It basically sends out, like it prints out the contents of a file onto the standard output or the screen. And this will make more sense when you start seeing what these things do. And man is kind of amazing. If you, especially if you're learning, I use it all the time. It tells you, it's kind of like a help for all the commands. So it'll show you like all the specific options and what the commands do, even tells you history on the commands. So I'm super handy. Now commands, they have what's called flags or options. So here we have the LS command, okay? Now if you do, like on Windows or Macs, you know how you have hidden files, right? That you can't see or like system files. Same thing with Linux or any kind of command line. That if you do LSA, it shows you those hidden files. And I'll show you this in one second after this slide. And you have LSL, which is kind of like a long listing, more information about these files. So it's kind of like a more verbose information. And you can actually also put flags together to kind of combine them. And CD change directory also is a little trick there. If you put a hyphen next to the CD, it kind of lets you jump back and forth between the last and the current directory. So I'm going to do a little quick demo of this. I think I am. I'm not. It's because I don't have a new window. One second, let me create a new window so I don't loose this stuff here. Actually this is my home directory. So here we have my directory, right? I have my prompt to actually show me that with the directory I'm in. Some prompts don't. So if you do PWD, it tells you the current folder, right? And then we have LS shows me... Actually, let me go to my home directory. So if you hit CD and nothing, it actually takes you to your home directory. And then this is my home directory. What's in there? If you do LSA, it shows you all of the hidden files as well. And then like I was saying earlier, if you do LSL and then H, this shows you the right permissions on the left, the user and the group that owns those files. And that number in the middle there, like the row, these over here, they are what the size of these files are, which is essentially meaningless to most people. So if you do LSH, which is that other option, it actually shows you... I don't know why that's not standard, but it shows you the actual sizes. When you start messing around in the command prompt a lot, you do want to know what the file sizes are, et cetera. So this kind of helps a good bit. So those are flags on how to use them. This one's something you want to be a little bit careful with, RM, that's remove, it'll remove files or directories. And remove RM, RF is unforgiving. It will erase everything that you have there, basically. There are some not-so-fun scripts that will erase all of your computer with it. This specific command, so we have the recursive flag, that's the R here, and the F, which is for force. Now this here, what this does is it'll actually let you essentially exclude files. So this white box here is an example of that command line. Touch is actually another command that lets you create files. It'll let you create a blank file, and then the brackets there is a bracket expansion. Basically, so you touch files and that lets you create five files named file one through five. So you see at the bottom, I do touch file one through five, LS, and then when I LS, I see this file one, two, three, four, and five. It may be going a little fast, but I hope you're following me with that. And then I do that command that I've ponied up here and do an LS again, and it kept those files there. Now this may not seem like something you want to be doing when you're just working on your computer, right? But this is super handy when you're scripting, because later you want to maybe create some files and erase them later, but save these, etc. So this is great. I don't know, does anyone here actually just day-to-day just browse around and work on their computer on the command line? Really? You just use the command line only and you're not on the GUI? And expect it, awesome. Kudos. There was a tie-in, though. Nice. That'll do it. So my leak was just a sensation to a host server doing all my work on my phone. That is super awesome. That's probably why you know so much about it. Part of it, at least. Yeah, so, you know, I mean, some people actually do 100% work on the command line. Maybe it's not 100%, but sometimes you have to connect to server and you work all day in command line. No, no, for sure. I mean, yes, not often by choice, right? If we have another option, we'll go to the graphical interface often. But my point being that, you know, a lot of these things may seem kind of like, why would I want to do this when I have options? But again, sometimes you don't have options and also you have a graphical interface. But the scripting will help you a lot with it, with these things. Now, aliases. Anyone who's familiar here with aliases? So everyone, awesome. Smart bunch. Great. So aliases basically are commands that can be a little convoluted or long to write and you just get tired of writing them. So you can add them to, I'm kind of strictly a bash guy. Bash is the born-again shell. It's basically on every server out there. There are some that don't have it rarely, but so that's kind of a choice to use that one. Mac users will use some other ones sometimes. I think ZSH is a popular one as well. So I'm saying that because aliases, you can actually add them to the bash RC file on your home directory. This tilde here represents your home directory all the time. When you see that on a script or anything like that, that means the current user's home directory. So here, let's see, I'm going to do a little quick demo again. I'm going to SSH onto the server again. So I am stuck with the command line. So I have an aliase here for get pass. So what that does is it calls this program, open SSL, creates a random base 64 string of 20 characters. So it kind of creates a password for you. So it's get pass. If I type get pass now, there's nothing here that doesn't exist. But you can also create aliases temporarily, which is exactly what I'm going to do right now. You do that. And now if I do get pass, there's my random password. Again, great for scripting. One thing to know, you may have noticed, if you press up and down on most shells, it'll kind of give you the previous or next command that you wrote. I can just kind of go up and down, and it shows you what I've been writing. So it's good to kind of not have to retype things a lot of times. Another popular one, at least that I use, aliases, is there's a sudo. I don't know if you're familiar with that sudo. It's basically when you're trying to do on a command line an administrator permission command. And you'll just get no permission to do it. I mean, well, I don't need to show you, I guess. But something such as apt-get. apt-get is a way to install software, at least on Ubuntu-based software or Linux. And if you do this, then now you don't have to type it anymore. You just do apt-get, and it'll actually just do sudo before. sudo stands for super user do. Kind of an easy one. So it's good for easy wins. Speaking of easy wins. So now let's talk about WPC-li, and we'll later kind of put them all together into actual bash or shell scripting and WPC-li. The idea behind WPC-li is to be able to do anything you can do on the admin page, the WordPress admin page with the command line. So I believe they're pretty much there, but there may be some things that you can't do on the command line. And again, with that, what's the point if you can just do it on the, you know, on the screen, on the browser. But the idea, again, is scriptability. You can just actually just write one single script and do a bunch of things all at once. Or also even things that I'll be showing you in a second. These are commands that I use a lot. They're pretty popular or pretty common. One is to back up your database. Super easy to do. You just do WPC-li as the command for WPC-li. So you do WPC-db-export. I'm going to change the directory to the server, where the server is. So here you'll see all the, see I do an LS and you see all the WordPress files, right? If I put in that command here, now you see this is a small size, short small site, but it immediately created a backup of the database. And yes, we can do this with plugins, but this is fast. Another thing I think it's pretty awesome is WP media regenerate. What this does is sometimes you have to recreate it, all your images because you changed your theme or just the way your sizes of your images are, right? And then your site stops working, it doesn't look right. You have to use plugins such as what does it mean to regenerate, to regenerate thumbnails, I think it's called. You can do that, or you can just type that up or have it in a script, run it, and then it'll just regenerate all of the missing only with this flag image sizes. And this one is the personal favorite of mine. I just kind of found it out the other day and it's super awesome. It's WP checksum. Checksum, does anyone not know what a checksum is? Checksum is basically like a long number that, I'm actually not going to explain this very well, but a checksum is a number that represents the exact content of a file. So if that file gets changed, that number would change also. It's a way to kind of make sure that nothing has been changed on a file. You do that a lot with security or when you do downloads you're supposed to check some. What this does is it actually checks, does that on a checksum of the WordPress stock installation and also the plugins that are on the repository for WordPress, it'll do that also. So you can run this command, of course I just installed this WordPress installation so there should not be any problems, but it basically checks all of the files. See if anything has been changed without you knowing. Kind of like a hack check of sorts. I wouldn't just rely on this, but it's kind of nice to know. Like, oh, this is an extra file here now or something changed. And actually, you know what? I'm going to do a quick thing just to note. If you just hit WP, it will show you all of your available commands and as you can tell here in some explanation there's a lot of them. The WP-CLI.org website has all of this and much more in depth. And you can also just kind of hit help. Do a command and just put hyphen help and it'll give you a lot more information. So here's some kind of common issues. Show of hands. Anyone ever seen a white screen of death? You know what those are? Fun, right? Or, you know, get up and sell a plugin and it just breaks your sites or some functionality changes and you don't want to have to go and fix it all and see what's happening, especially on a live site, right? Or what I do a lot of times, if a new update comes for a plugin that I'm not really sure about, I'll let it sit for two, three days just to make sure that, you know, things are sorted and it's actually working well. And even sometimes I may forget to update for a month and an update just came out so maybe I want to do the previous update, right? So with this command here, you can actually select the version that you install. What that does is it kind of mitigates hopefully most of those three problems because you can essentially roll back that installation you just did to a previous version of the plugin. Slug here. I use slug a lot here. We all know what a slug is, right? So a slug is like a short name for your plugin or when you go to WordPress, if you search for that plugin, the slug is like its short name. It's on the address bar of the browser. Same with your theme and all your posts. The post slug is what's on the address bar of your post name, essentially. Well, sometimes hopefully if this doesn't fix something that you would like it to be, you can do wp-plugin deactivate and then the plugin name from the command line. What this does is it lets you save a lot of time. You know, often you may not be on your computer, on your screen and you kind of need to get things done or someone calls you and tells you, hey, my plugin broke on the X site that I'm maintaining. So you just kind of are there already? You just hit the command and you're done. As opposed to having to load up things and wait for logins. And also you can deactivate and uninstall plugins just by doing that. Actually, let's do that one here. So, nothing against the hello Dolly plugin, but I'm going to, what is it actually? Sorry, uninstall hello here. And so disable deactivate, oh boy, I should know these things. Deactivate. So there I just deactivated and uninstalled hello Dolly. Which is another thing that I like about this is that when we uninstall plugins, often you have to, as we all know, you have to deactivate it, wait for it to deactivate and then uninstall. This is one command and you're done. If you have any questions, don't hesitate. I kind of give a bit of buffer of time, so feel free. Is there a command to list all the plugins on the current site? Yes, there is. You do WP, I think I used it in a little bit, but it's a plugin list. And then it shows into you, I just installed this and I uninstalled the other plugin, but it shows a Kismet and it tells you if it's active or inactive, if there's an update on the current version of it. So then you can use the parameters there to deactivate. You can do a list, see what you have. Yeah, we'll get into that. That's a little ahead, but yeah, exactly, exactly that. Updating a password. So anyone ever forgot their password or forgot a password for a WordPress site? So that's not fun, right? You have to follow all these steps. You go, you click on the forgot password link, you enter your email or username, you wait for that email, you open up your email tab or program, wait for that to come through, then you click on the reset button, it takes you to the site again, you have to reset the password, and then you got to go and log back in, right? Or you can just, with this, yes, it's a station to the server, go to the WordPress directory, use this command and it is updated. You're done. I could do that right now, actually. What was my, I'm not going to use this password though. But my password, I set it up as one, two, three, right? So I'm going to do this and I'm going to say password three, two, one, because I'll forget otherwise. And we'll see this come up later. I'm going to have to log in later. So you'll see that it's already changed. It updated the database and we're all set. You can also, I suppose to create your own password that get past command that we did earlier, right? The alias and not have something like this cool password I created there. Another thing yesterday, we had a talk about working with child themes. Was anyone from here there? So this command here will do that in a flash. You're done. You just hit this and you just created a child theme from your currently active non-child theme. You can't create a child theme from a child theme. So what is happening here? If you're noticing it's a little bit more convoluted than the commands I've been showing you. This is using command substitution. What happens with that is that anything within the dollar sign and parentheses is a sub-command that opens up a new shell, essentially, and runs that command. And then the response of that command gets put into that space. Okay, so I'm going to show you what that means right now. This is this WP theme list active themes and it's going to only show me the field name. So what we saw here, right, here we have the field name, field status, field update, and field version of that listing that I did earlier, right? Here I'm going to do the same, but it's only going to show me the 2019 theme. If I did without field name only, it would show me all the information. So going back to this, this here is going to be replaced by the name, by 2019, right? So this is command substitution. So what I'm going to do now is I'm going to run it again, I'll run this command, and we'll see that now it's switched it to, I forgot to change my theme name so it's now called slug. But that's okay. So now if I do that again, I see that my current active theme is slug. With that command alone, I just immediately created a child theme. And I don't know if someone timed it, less than half a second. And that's one of the magic tricks of WPCLI and how they develop it, like part of their, yeah, how they develop it, is that they want commands to be single use, but composable. So you have a command that will, nothing will use, but a command that has like one purpose and it does it well. So there's like the plugin command that installs a plugin and that's it. And you think, or like the listing ones, like who cares about listing plugins, that doesn't seem so handy. But when you couple it with other things, you're like oh I'm going to get a list of active plugins and then update only the active ones, not the inactive ones. So I'm going to do a lot of things, you kind of like start putting these commands together. It's super, super, super handy. This happened to me the other day. I have a client that wanted me to help clean up their site and I went and logged in and saw that they had literally 132 installed themes. I don't know how many of you have ever seen anything like that. That kind of freaked me out a little bit. Most I've ever seen was like 7, 10 maybe. And when you have to uninstall a theme and at least the dashboard, you got to go to the dashboard, you select it, you hit the delete button, you wait, then it does it, and you got to go and do it again, right? After three or four, it gets kind of old. And that's again the reason why we do scripting. You script this and it's done. You don't have to even think about it. Excellent question, no. Because if you look at the code here, right, it says WP theme delete, and then I'm doing a command substitution, right? You see the parentheses there. What you're doing is WP theme list, status inactive, and then field lame, name, not lame. So what this does is that lists all the inactive themes. So it excludes the active ones. So the parent is treated as active even when you are using child theme? No, but you're not using a child theme. So it gets out. Oh, I'm sorry. So what happens with this is inactive. There's three things here. There's inactive, I think it's parent and active. Or something like that. There's like a distinction between parent and child themes also in the list. I checked, trust me, because I don't want to be raising all of their themes. But yeah, there's a distinction. The inactive is specific to it not being active or being needed at all. Because the parent theme also kind of has its own field name. Actually, we can see what it is here, right? Oh wait, not active. I want to see all the themes. It is parent. So this active, parent and inactive. Yeah, you know how I found that one out. So again, be careful with scripting. So this one, this is possibly the only thing that WPCLI can do that the dashboard cannot. There are plugins for this, but this searches and replaces your database. Super awesome, super dangerous. Be very careful when you start messing with the database. That's what we do, the previous command that I showed you, the backup database. Kind of awesome, right? So what you do is you do WPCLI search and replace, something old, whatever you want to replace with something new, whatever it is. And then I have the report changed only command there. Just to keep it simple sometimes when you ask it to do things, there's a list of the whole database tables, and it'll say zero changes, zero changes, zero changes, zero changes, one change and like 50 zero changes. So this shows you only the things that it actually changed. And dry run is something that you want to do because, again you're messing with the database, so dry run shows you what it's going to be doing before it does it. Yeah. Could you specify this only certain tables? I'm not even going to get into that, but yeah, if you look at this command it has a ton of options. Yeah, especially specific tables. You can say wait to exclude, and tables that start with what, you can do every table on the database, things that are not even an inward price I believe. You can do a lot with it. I believe so. We'd have to look at the help on it. I can do that in a little bit if you want. Does it unserrealize data? Yes, my understanding is that it does. Yeah, it does deal with data serialization, which is awesome because otherwise, it's just a point. So wish me luck here. We're going to do a demo of WP Search and Replace. So we're going to go to the site that we had earlier, right? And we're going to, what are we going to do? Let's see. We're going to create a link on the Hello World Post. So we're going to go to Post, Edit, and yes, Gutenberg is great. And I'm going to do Control-K. It's a shortcut to add a link. And I'm actually going to link it to itself, this super meta here, an update. Let's view this post. And what we have here is a link to itself, right? Now you see it's new.localhost. This is the stock Permalinks that WordPress has. So it's the year, the month, and the day, and then your post. More often than not, people don't want that. I've come to find out. They often just want the post after the name. Okay? Sorry, Sergio. Yeah. Wait a minute. Okay. We're good. Thanks. So what we're going to do is do a bonus round here and do WP Rewrite Structure, which will change the Permalinks. Now what you're seeing here is actually my script here kind of messed this up a little bit, so I'm going to have to type it. It's supposed to be a percentage sign post name, but that's how I change things. So I'm going to just type it in. There we go. So what this does is going to change the Permalinks to be just the post name and get the dates out of there. So let's go over here and refresh, and what happens, that's not working anymore because it has the dates on it. So let's go back to this awesome installation, and now we see that Hello World is there, and that's great, and now our address is Hello World, right? But what happened here? The date is still there on the links, and now we want to do, what do we want to do? Just change it, what do you do? Edit the post, right? Super easy, no big, no biggie there. So link is gone, and you just update it. But what happens with another command I'm going to share here is WP Create Post, and I'm going to actually just essentially copy the post with ID number one. So I just now created two Hello World posts, right? And no big deal with that, what do you do? You just edit two posts, who cares? But let's say you've been running your site for a long time and you have a lot of links to change. This one here, I'm going to run, this is a bit of a bashism of sorts, but I'm doing that for loop with the bracket expansion. So I'm running 10 times, and then this two exclamation marks basically means the previous command. So the previous command was WP Post Create, right? So what this is going to do is it's going to create me 10 copies of that command. So now what do we have? We're going to have, I believe, 12 posts to edit. And that gets to be a little bit less fun to go and edit each single one, right? So we do this crazy command here, which is, it's basically a regular expression. Reg X, if anyone uses it, I try to learn it. It's awfully hard to learn. And some people here may be great at it and I'm so jealous. So what this is doing here, I'll just kind of go real quick by it, but 0 through 9 is, basically what it's looking for, anything with a dash that has four characters that are anywhere from 0 to 9. And again, repeat it. Another dash with two characters, 0 through 9, and another dash, same thing. Another dash, and then the post, anything that has A through Z, 0 through 9, a hyphen or an underscore. And then these parentheses basically makes it a group in this Reg X. This is beyond the scope of this talk. And then that gets put into a one. So basically this is the old thing and that first group is essentially represented by the dash one here. So I'm replacing all of that, anything that has all of that links with the one, with the post name. And here's where I'm going to just cross my fingers. We're all going to hope that this works. So we're just going to run it. Actually, let's do a dry run. Just a dry run, right? We've got a hyphen there. So this runs and it tells me it's going to replace 13 instances in the WP post content. Actually, yeah, here, well, anyways, so now I'm actually going to run it and hopefully it says to change all of them and now we're going to see that it changed them. And if it did, I win. Yes, the internet wins. There it is. So now all, every single one of those links is changed. This can be, I'm sure we can all think of reasons to use this exact scenario for many things, right? If you have, I mean, things that you've written a lot, you might change all of them in all of your previous posts. Now, aliases, there are also aliases in, how much time do I have? Oh, my good Lord. Okay, there are aliases with WPCLI that make it very, very handy because you get to use, you get to call the servers from your local computer. So basically what happens is you add something like this. You have ad production and that's your aliase for the server and then this is your SSH information for the server that you would be connecting to. You can also do aliases that are groups of aliases and you would put that in this file here on your server. I'm going to go a little, I mean on your local computer. I'm going to go a little fast here. What that lets you do is do commands from your local computer as opposed to SSHing into the server. So on your own computer you can start using WPCLI and tell it to run it on those servers over there. I ran out of time. There's a lot here that is actually pretty good. Okay, so one quick thing I'm going to go into this here is something that lets you export your database onto your production server and then from your development server import it directly into your production server and then do a search and replace of the address on there so you kind of do a quick swap that makes it super easy to do stuff like that. These sites, these will be online and I am out of time. Right, not my time. Okay, so thank you, they will be online. And this is the address to where the slides will be right there.