All right we have two more important command line commands to learn before we can move on to node and
express and actually writing code.
So those two commands are our AM and the other one is r.m dash Aref.
Technically this is actually just one command r.m and this is something called a flag which is a way
of changing what the command does.
Let's begin with r.m.
We use our m to delete a specific file.
So in this case let's go to the fav colors directory.
And as I mentioned before blue and green are not actually my favorite colors so let's get them out of
there let's just delete them entirely.
So we need to CD in two colors slash fav colors just like that and we can see blue green and purple
to remove blue dot text.
I need to first type on them and then the name of the file.
So r.m Blue Dot T or use autocomplete member of that tab.
And if I type LS It's now gone.
I don't know if you noticed but it didn't actually delete from the file tree yet.
And that's just a matter of it lagging a little bit behind because remember when we actually delete
this file it's on a computer somewhere else.
So on one of cloud nines computers that they've designated for me to use here.
So when I delete something yes they send the command from my browser to their computer.
It then deletes the folder or the file and then once it's been deleted it then sends something back
to my file tree to tell it to remove blue dot to 60 from the display.
So sometimes it likes a little bit which is another reason that it's good to just use the command line
.
Let's also remove the green tea XTi.
So r.m green tea XTi.
And now we're left with just Purple about THC which as I mentioned is my favorite color.
So that's how we can remove individual files.
And then the other command is r.m dash R.F. which allows us to remove entire directories.
So I'm going to back out and one more time and I'm going to delete the entire colour's directory and
that means getting rid of orange red and yellow that he XTi as well as fav colors and my beloved purple
that THC going to get rid of all of them by using Ahram dash Aref
the dash R.F. stands for something that you might not expect.
It stands for recursive force which basically means that when we say delete colors it's going to delete
all of the child directories that colour's contains.
So not only the files here but it will delete fav colors and all the files inside of that.
And that could go nested as many levels as we want.
It's going to force delete everything inside of that directory.
Technically Ahram and r.m dash R.F. are the same command line command and dash Areff is a modifier or
what's called a flag for the r.m command.
So it's still the r.m command.
But dash R.F. will have it do something slightly different.
And then we need to provide an argument which is the name of the directory to delete.
And in this case it's colors.
So r.m dash R.F. space colors and I hit enter.
And you can see my entire colors directory just disappeared.
If I type LS over here there is no colors director anymore.
If I try and C.D into colors it tells me no such file or directory and it's all gone including my fav
colors directory and my purple that TXI the file as well.
To summarize r.m will delete an individual file and Ahram dash R.F. will delete an entire directory
.
One interesting note about r.m dash Areff is that if you're not careful and you use it in the root directory
of your entire computer you could actually wipe everything from your machine.
And I've never actually seen that or heard that happen.
It's almost like an urban legend I guess at this point but it is something that is technically possible
.
If you did r.m dash RF slash which almost scares me to even type that even though I have nothing of
value on this workspace yet.
If I hit enter that could delete every single thing in this workspace.
It's an interesting tidbit but it's also worth knowing about