SCRIPTING
INTRODUCTION
TO LINUX
COMMANDS IN
CYBER
SECURITY
INTRODUCTION TO LINUX COMMANDS IN CYBER SECURITY BRILLIANTLABS.CA [email protected]
S C R I P T I N G S C R I P T I Ni G
IN THIS EDITION
Before you can start creating scripts, it is important to know how
a console works under Linux.
To achieve this, we offer two complementary activities in the
online course Introduction to Linux commands.
You will find the activities in this guide without any additional
information. It is therefore recommended that you take the online
course to get all the necessary details.
https://learn.brilliantlabs.ca/courses/course-v1:BL+CYSEC-BASIC-ACT-
02+9999/about
INTRODUCTION TO LINUX COMMANDS IN CYBER SECURITY BRILLIANTLABS.CA [email protected]
i iG
SCRIPTING SCRIPTIN
TABLE OF CONTENT
In this Edition i
Activity A : Folder Structure 1
Activity A : A Solution 2
Activity B : Creation of a File that Contain Text 3
Activity B : A Solution 5
INTRODUCTION TO LINUX COMMANDS IN CYBER SECURITY BRILLIANTLABS.CA [email protected]
S C R I P T I N G S C R I P T I N1G
ACTIVITY A
FOLDER STRUCTURE
Now that you've got a few commands under your belt, here's a
little exercise to put them into practice.
Instructions
Using the commands you have learned so far, create the following
folder structure:
This activity is linked to
an online course
Find the solutions on
the next page.
Folder Structure to Reproduce
INTRODUCTION TO LINUX COMMANDS IN CYBER SECURITY BRILLIANTLABS.CA [email protected]
2G
SCRIPTING SCRIPTIN
ACTIVITY A: A SOLUTION
Here is a possible solution. Other solutions exist. The goal is to
obtain the desired result. If you have created your folders and
files, you can consider the goal as completed.
Solution - Activity A
You will notice that
there is a small error.
You should have written
touch kernel.kit instead
of kernel.kit.
INTRODUCTION TO LINUX COMMANDS IN CYBER SECURITY BRILLIANTLABS.CA [email protected]
S C R I P T I N G S C R I P T I N3G
ACTIVITY B
CREATION OF A FILE THAT
CONTAIN TEXT
In cyber security, it is important to know how to insert text into a file. This task may
seem simple, but it is a little less so in console mode. With this knowledge in mind,
you will be able to use this practice to eventually create log files that are very
important in cyber security.
Instructions
Using the echo command and the > and >> symbols, insert the
text for each statement into a file. Check the result with the cat
command
Example
The Command echo to insert text
Additional Information
When you use the > symbol the text will be added to the first line
of the file. If there is already text in the file, the text will be
deleted and replaced by the desired text.
When you use the >> symbol the text will be
added to the next line and the previous text will be
saved.
This activity is linked to
an online course
INTRODUCTION TO LINUX COMMANDS IN CYBER SECURITY BRILLIANTLABS.CA [email protected]
S C R I P T I N G S C R I P T I N4G
Exercices
Text to Insert Filename
1. Cybersecurity is an exciting field. cyber.txt
2. There are several specializations cyber.txt
in the field of cybersecurity.
3. One must act ethically when ethic.txt
using the tools in Kali Linux.
4. We are here to help defeat those our-goal.txt
who have bad intentions.
Find the solutions on
the next page.
INTRODUCTION TO LINUX COMMANDS IN CYBER SECURITY BRILLIANTLABS.CA [email protected]
S C R I P T I N G S C R I P T I N5G
ACTIVITY B : A SOLUTION
Here is a possible solution. Other solutions exist. The goal is to
obtain the desired result. If you have created your files with the
necessary text, using the echo command, you can consider the
goal as completed.
Solution - Number 1
Solution - Number 2
Solution - Number 3
Solution - Number 4
INTRODUCTION TO LINUX COMMANDS IN CYBER SECURITY BRILLIANTLABS.CA [email protected]