 Hello and welcome today. We're gonna be looking at random word lists and dictionaries I was recently asked how to generate a random list of words Well, if you're running on a Linux system or probably a lot of other systems as well that are you know I'm assuming DSD and whatever not but on a Linux system. You probably already have a large list of words So for example on my Debian system if I cat out usr share Dick and the file called words it gives me a big old long list of words in fact Let's count out those I'm gonna say I'm gonna say wc-l and it says Yeah, 102 thousand four hundred and one words listed in there So is that that is from my dictionary file Which is you probably have one for whatever the default language on your system is and this is used for Spell check and word prediction and probably a few other things But um, it's usually there some systems may have it under just usr dick words Which obviously I don't have that there Debian based systems. It's gonna be here I'm not sure. I've just read that it's in that location on other systems Sometimes different distros put things in different places. So again, you can cat that out if we were to list out What's in that directory list you can see here that there's a Sorry in that directory you can see there's a few files in here and if we list this out as so you can see that words actually pointing to This file and we can cut that out and you'll see that it's the same file And if we list that out again, you can also see that there's a prediction things looking towards this American English here So we can actually cat that out as well. Let's see cats Let's see what's in there. So basically I'm just another list of words there So that's a long list of words. Obviously you can download lists offline But this one's already on your system for your language, but how do you get random words? Well, if you are on a system that has chef talk installed which I've talked about in past chef is a program that shuffles things So we'll say words again, but instead of cat. I'll just say chef And chef is common at least on Debbie and distributions. You should be able to install if it's not installed It's also built in a busy box. So very very useful. So it's gonna just every time do that It's kind of like catting it but shuffling up all fuss. Obviously if you don't have chef you can use something like You should build a cat and then I can say sort dash R. I believe and Oh, no, that's reverse maybe capital R Yeah, it took a little bit longer, but that will give you a random. So it's another option It's not doing it as a efficiently as chef, but sort is definitely on your system. That's everywhere So capital R will give you a random output there from that so you can shuffle that way going back to chef here Chef also gives you a nice little option I could say dash and 10 and will give me 10 words randomly each time from that file going back to sort I don't know sort has a Limit if I did like and 10 now that doesn't work so what we could do is put that into head and I will get 10 Obviously capital R. We already said that Again a lot slower, but you'll get 10 random words each time you run that and if you want a different number of words You do dash and I'm like say 20 So that's piping it. It's a few different commands, but those are all commands They're definitely on your system already, but again going back to the chef command We can say chef 10 or 20 however many words we want We can say two or if you just want a random one random word You say one and every time I run that I'll get a random word now if I want to put them all on one line So I can go back here and say 10 again. Whoops So chef 10 What I can do is I can use something like TR TR replaces a character I can say well if I do dash D and I give it the backslash n for new line character It's going to put them all as one word So it's removing the new line characters and just pushing them all together if I want spaces between them I can just say TR and I can just say Backslash n and then inside the next quotations a space and we'll put spaces in there or I can do dashes And we'll put dash between each one whatever you're trying to accomplish with these random words You can do that and of course as you can see there are apostrophes in there because again, this is used for Spell check so if someone has an apostrophe name you want to be able to Get rid you know use that so you can do lots of different things I can say chef 10 and I can probably say grep dash V and then say here a little quotation mark or apostrophe inside quotations and V will give you a reverse so it should give me every line that doesn't have Of course, that's going to narrow it down a lot with my 10 because so I probably would want to do something like This we'll say we'll start with the grep command. I'm just giving you options here on what to do I can say grep all lines that don't have an apostrophe in it and Then we can shove that and I'll put only 10 and then we could so now I'm not going to get any words that have An apostrophe in it. You can also, you know Do something like this again? I'm just giving you options here with TR I should be able to say capital a dash capital Z inside brackets there To inside brackets lowercase a to lowercase c and I believe that's the command that will make everything Lowercase so that will remove and if you want to do it the other way you can go a Z to capital a Z and now it will uppercase everything So those are a bunch of different options there on ways to play around with random word lists. I hope that you learned something new I hope you enjoyed the tutorial if you did check out my other videos at films by chris comm That's chris the cake. There is a link in the description go ahead and check that out there you can search through all my videos and If you like my videos think about subscribing commenting sharing all that great stuff Also, if you go to films like chris comm. There's a support link I'll bring you to you can either support me through patreon Monthly or paypal if you want to do a one-time thing those links are there also check out the description of this video And if you can't support me that way support me by liking and sharing my videos I thank you for watching and as always I hope that you have a great day