- Okay. So, the first command
in this lab is to create TMP files pictures.
So, let me do MK there, old files pictures.
(clicking)
And files photos and files videos.
And that should actually work.
Oh no. Cannot create, cannot create, cannot create.
Does that make sense?
Of course, it makes sense, because we did not
do any minus P.
Now it works.
And if I want to see what is inside,
I can use LS minus R on files.
And there, we can see the contents of these files.
One command that we did not talk about but
I can't help myself.
And I want to show you anyway, is tree.
"Tree", we'll show you a tree hierarchy and the tree
command makes it easier to see what exactly is
happening and where it is happening.
So, that's one command to remind, I think.
Next you want to copy all files that have a
name starting with an A, B or C from ATC to TMP files.
"How do we do that?"
Well, CP slash ETC, and then you can choose
either you open a square bracket, followed by A dash C
or ABC star to, and where did we need to copy it to?
We needed to copy it to files.
And do remember, if your destination in
copy is directory, better make sure you put slash
behind it to avoid any confusion.
We can safely ignore all the error messages,
because that is not really important.
What is important is that we can see a couple
of files that have been created in the TMP
files directory.
Next, from TMP files move all files that have
a name starting with A or B to TMP files photos.
So MV, and I'm going to persist in using a relative
pat name.
So files AB star to photos,
and ah, that's not going to work.
That should be files slash photos, and that is doing better.
And next we need to move all files with the name,
starting with the C to TMP files videos.
I can go for the lazy man solution here.
What do I mean?
Well, what I mean is that the only thing remaining is files
with the name, starting with the C.
So, I can use MV files.
Ah, C star.
I can also take out the C if I want to.
Is it really going to work?
Well, in this case the star is going to be
interpreted as everything.
And you'll notice that it's not going to work,
because everything includes photos, pictures and videos.
So, lazy man is fine, but not in this scenario.
I'm going to move these files C to files slash videos.
And there we go.
Ah, We have removed it.
Now once again, tree is a nice command to figure out
the result and here we can see the result.
And do you think we still need this directory structure?
I don't think so.
So RM minus RF files will remove everything and that's all.