All right. Hello and welcome
to Command Line Survival, part one
for the command line basics course
here on SIBERRY.
So this module
will take you into a bunch of
different tips and techniques that
you can use to really work through
the command line and save
time and hopefully
help get you much more comfortable
with the command line.
So in this module, we've going to
learn autocomplete techniques,
learn how the Iraqis are utilized
at the same time and understand
how did you come in history.
These are all very important
concepts that you need to understand
while you're working at the command
line.
Right assessment, so what is the
best way to cement a previously
entered command?
Is it going to be a pressing the
control key and H.
B, open the Basche history
file and copy paste, C,
use the up arrow key or D,
press the control key and Z,
we want to resubmit a previously
entered command.
If you said see the up arrow key,
you're correct.
It helps cycle through previously
entered commands and is very
quick and easy to use.
Pressing the control keying H does
not really do anything.
The command line and it
is true you can open the Basche
history file and copy and paste
it into the command line
window, but that's a lot
of extra steps and it's not very
easy.
And then pressing the control key
and Z actually ends
any running process at the command
line terminal, which will learn in
the our command line
survival part one.
All right.
So typing commands
in order to type of command, you
need to be able to
identify what you're trying
to accomplish.
It's it's very easy to start
typing commands without
knowing exactly what you want
to do.
So if you can understand what
you're trying to do from the command
line, then that
will help you choose which command
to use which which is what
parameters and how to really attack
your problem.
So like I was saying before, the
command kind
of syntax is you need the command,
a switch and then a parameter.
So in this example,
we are going to search for
a weakness, grep search
for Frankenstein and
we're using the tech or the dash
switch.
And if you look it up in the manual,
the dash I switch,
it stands for case insensitive.
So if we look for Frankenstein,
it doesn't have to be capitalized
and it'll grab
matches for anything that is not
capitalized.
And
you can always press the energy to
enter your command.
Pretty straightforward.
All right. Some very important
commands that you need to understand
while you're working at the command
line. We have probed
stands for Working Directory.
It shows the current directory you
are in while you are in class.
This is very useful.
So you know what is where
you're at in the file system.
Now, if you want to know what's
inside of the directory you're in,
you're going to use the command
for windows or the endless command
for Linux and Dursban
for directory.
And Ellis stands for listing
and it lists everything in
your present working directory,
that working directory command
that you just used.
And it will show all the files in
there.
And then if you want to be able to
move to a different directory,
you're going to use the CD Command,
which is change directory, and
that will help you move to different
folders so you can look through
Uster or else from there
and be able to see what's in there.
So let me give you a quick example.
So for here, this
is for Windows.
If I cheat,
we are going to do different work
directory.
Excuse me.
So this will change
everything in our directory here.
This is for my personal folder.
And then if we want to change
directory, CD
and desktop,
because we can see that there is a
desktop folder here.
All right. And now we're inside the
desktop folder.
If we want to see what's inside of
there, type DYA
and enter.
And this is what we have inside my
desktop folder.
This is for Windows.
All right. So for Linux, we are
going to type DVD
and this will print a working
directory which is flash home slash
user.
And you can also tell because
before the command line symbol
we have the tilde, which,
as you know, when Linux is for the
home folder and
now if we want to see what's inside
of this folder, I'm going to type
for list and it shows everything
inside of this folder.
Now, what I highly recommend for
doing as a security professional is
to do Ellos Tech LTA
and that will list everything
and show you
all of the permissions
for the files.
And it will also give any
hidden files.
So as you'll see right now,
this was the first listing we got
and it showed all of these folders
that I have.
But these files,
they don't, as you know, are hidden
files and Linux and
using the A switch
and lets us see all the files,
including the hidden files.
So this batch history file,
it is not in this first listing
because it is a hidden file.
All right.
So let's move on.
So autocomplete techniques,
we use the tab key tab
completion is your friend.
It will save you so much time.
So it will only complete within
the present working directory that
you're in.
And if there are more than one match
for something you're typing
out, you can press tab twice and it
will list all the matches.
So let me show you here
that say dot
less
dot B, because we have
a bunch of files, three
files here that have the be there
and they all start
with Besch.
So I push the tab there and
if I push tab twice, it will show us
all of the files that match
that.
But let's say I want it to change
or go
through the pseudo add admin
successful file.
That's a lot to type, right?
So we type Suto
sound right here and
then tab and it will auto completed.
Also I don't have to type it and
that's great because it saves
my time. Saves your time.
We all do. Great.
All right.
Aoki's at the Seelie.
We get the up and down key up
scrolls through previous commands
and down scrolls back from
the key super useful.
It will save you a lot of time
because you were going to be
constantly repeating commands.
So let me show you that real quick
so
you could see a push up here.
And we got back our previous command
push the up key again, our
delay.
Ellis pretty.
If I go back down the down
arrow, it bring us back down
through those commands.
That will save you a lot of time
because you're going to be
constantly resubmitting different
commands that you were doing as a
secured.
All right. Command history for
Windows.
Pretty straightforward.
We have the seven key and you can
also type dashikis flash history.
Now, it is important to note
that there is no persistent command
history in windows by default.
And if you want to save
your command history in Windows,
then I'd recommend
typing the slash history command
and then just copying pasting
everything right out of the command
window into a text file.
Other than that, there is no really
kind of persistent command history
like there is for Linux.
So like I was saying for Linux,
there is the best history
file in a home folder
and that records a user's
history in the back in
the shell.
So if you as I showed
up here in the top right, if we
do cat bash history
and you will learn that the cat
command is for CONCATENATE
and it spits out anything in a
file, and it'll show us that
all the previous commands that I did
for this user account.
And then there's also the history
covid where we can type.
We will show all the previous
commands that we typed as well.
All right, post the segment,
which command tells you what
director you're in.
Is it A pretty B
folder, C cat
or D Echo?
And we want to know which folder we
are in.
And if you said a DVD for
working directory, you're correct.
The folder command is a real
command.
The cat command is used
to spit out the contents
of a file for concatenate.
And it's not for telling you what
directory you're in.
And the Echo Command is
used to send
text back out of the
command line interface that you'll
learn. But it's not to tell you
which directory.
Right?
All right. So in this video, we
learned autocomplete techniques,
learned how to use the Iraqis that
are utilized at the Seelie and
understand how to view command
history. And I hope to see you in
the next video.