Teaching Cyber Security (Part 8)
This is the 8th post of a series for teaching cyber-security in a coding-club. Read [part 7]
Seeing processes
View all processes in a machine
You should have done the following:
sudo apt install htop
which means
sudo
: super user doapt
: use the package installer apt to get new softwareinstall
: installhtop
: a software called htop
to see if the installation worked all you have to do is type htop
on the shell (remember you can exit by typing the letter q
).
This will display a live list of all the programs that are running on this linux machine. Windows machines also have a similar shell called cmd
or command line. To see the running programs under Windows you can type tasklist
.
Autocomplete shortcuts
Complete your command arguments faster
As commands get longer, it's a little boring to type everything. The tab autocompletion keyboard shortcut speeds up adding command arguments.
Using the tab autocompletion shortcut:
Whenever you need to access directories or need to type file names, hit the keyboard's tab key for the terminal to autocomplete your request:
NOTE: Files and directories must exist in order for this shortcut to work.
try the following on the shell, from your home directory:
cd D
then hit tabD
hit tab again- then tab again
Is there anything in that directory?
come back up two levels with:
cd ../..
Do pwd
to make sure you are back to your home directory. If not, navigate back to it.
History shortcut
Tired of typing commands that were previously input?
Well, it turns out that there are 2 very useful keyboard shortcuts for exploring the command history.
The command history is a short memory storage of the inputs that were entered into the prompt.
Press the up/down arrow keys to get the last commands you typed:
To continue this course, Read [Part 9]