I know that it doesn't seem like much but you see this comment that we are using l RCP our M and V and
Tetra.
I think they pretty much represent around 90 percent of my daily job as a Linux user because I have
to copy things around move things around search for files look for executable is installing things so
these come as they are the core they are the essential code binaries that I use to kind of make sense
of things in my Linux environment.
There are just two other comments that I use a lot during my programing ex.
The first one is the common called grep which is the essential being what if find which is in this case
is in the user been fined that you think sometimes they are in demand sometimes their names are being
depending on how they seat in the essential single user mode of the Linux.
So let me just quickly talk about grep.
So here in my home folder let me enter this source folder which has a couple of examples of source code
that I like to enter the CTP game engine project and the CBP game engine project is very simple right.
It's just a source code of a 2D C++ game engine that I teach in one of the other course of the day.
So let's just say that for example if I do a tree of the source file right here because a lot of C++
code a lot of header file there is a lot of things going on here right.
My source code is not incredibly huge but it has a lot of files and sometimes we are programmer you
really need to search for content.
You need to search the source code for a specific expression for specifics between a certain word that
you're looking for.
So in this case let's say that I'm a programmer and I was doing something and I went to search the entire
source code of CBP game engine for an expression code delta time.
Right there is I know there is a variable in the source code that is called Delta time but I'm not sure
which file contains this thing so one thing that I could do is I could use the grep executable and grep
is the one responsible for an expression right.
I'm going to say why does the expression that I want and then what are the files that I want to look
for.
And then grep go we'll search the contents and look for that expression inside of files and bring them
back the lines that match that expression that I see.
I usually put discretion between double quotes.
So I want you to search for delta time.
So this is the expression that I want.
Where do I want to find this things.
Well let's just say that I want to find these things in all the files.
As soon as I enter here grep would go search for this delta time expression inside this files and grep
said Whoops I'm sorry inside C BBM engine I didn't find anything but I have directories right.
So I have assets lib and s RC.
That is true.
I don't want to grep only the first level I want to scrap all this sub folder and all this applies so
let's just say that I'm even smarter.
I know that the delta time is pretty much only inside the FRC sub folder inside the beginning engine
so I can go up with my arrow key.
Right so there is this history of comments in the show I can just go up up until I find my group again.
See how easy that is.
I don't have to type everything again so I just go up with my arrow keys were up delta time not in Star
but inside the source folder I see that helps.
Searches at the rectory again.
First star OK so here it is grep is giving me an output with all the lines where it found an occurrence
of this delta time thing.
So if is saying it inside the source voter I have component that H that has that delta time narrow parameter
he's also telling me that you see grep source forward slash components is a directory.
So there is an order directory inside source that may have occurred occurences which we're not searching
for.
So all these occurrences that he's showing right now is just the files inside source.
If I want to show again all the occurrences of the time he's tied to folders and the children folder
then the children or the children.
Why do you guys think we should do.
We could go up and say grab delta time minus recursion.
Right.
Nash char so everything that are inside of the time inside my source folder ok.
Now we're getting somewhere.
I have several occurrences of delta time.
In this case I have things inside source entities or Entity entity that H entity manager the TPP game
the TPP right where I'm actually declaring a float delta time.
So as a programmer I use this a lot during my day.
Unix is my development environment.
I can search for content using grep i can move things around quickly and I like having this control
of what I'm doing using the shell.
So if this is grep right it's grep the expression that I'm looking for.
And then the files that I want to search for and I can use this dash are to go recursively and et cetera
before I move away from grep.
I just want my stated grep this expression that we are putting right here.
It accepts regular expressions so regex just regular expressions that these are a way of those kind
of creating these rules of headers that we want to match.
So I have options of saying I want to find everything that matches only numbers or only certain email
addresses that have an at sign I can use different regular expression rules to go in search for specific
custom things that I want.
OK.
We might discuss regular expressions later because they are very important and useful thing for us as
Unix developers and Unix users but for now which is remember grep is a very important tool to me grep
the contents of files and we look for certain expressions and words and sentences remembering under
one day we spoke grep search for the contents inside of a file and find I usually use to find files
by name so if I know that I have a file side a folder that is called Game dot H right I have a game
dot header file.
So let me just enter my source code again.
Let's say that I have all this source code ported here and I want to find this game that H inside all
this focus and game on.
H is the name of the file.
It has nothing to do with the contents inside of the files.
It's the name of the file.
The pattern of finding.
I want to find where do I want to find things where I want to find.
Starting from the current directory.
Right so dot this source directory I am so find everything in this directory down and I can add the
option dash name because I want to find things by file name.
What is the name of the file that I'm looking for.
I think it's the game that H with a capital G.
S. searching searching searching searching done.
So there you go.
I found something inside the current directory CBP game engine or flash source for the flash game on
H and that is exactly the file that I was looking for.
So if I just want to add to that source quote I can say Remember nano game dot H and then I will probably
show me the contents of the file and I can edit and I can add my source code here.
So here we go.
This is the source code of the C code for the game H.
Founded by name.
Contracts code.
So let's evolve and move on to the discussion of users processes environment variables.
I think this is where we start to go into this 2.0 version of our course you.