Computer Science 2

Due Date: August 21, 2025

Cyber Range and Linux commands: Getting Started

Purpose

Step 1: Access Your Cyber Range Account to run your Python 3 program.

Note: To copy and paste between the Linux virtual environment and your Windows environment, use Ctrl + Shift + Alt.

*********** Read these notes below carefully **********

2. Open the Linux Terminal

Once logged in, locate and open the Terminal (command box).

3. Check if Python is Installed

python3 --version

If you see something like Python 3.10.x, Python is ready. If not, contact your instructor.

4. Run Python Interactively

python3

This opens the Python shell. Try typing:

print("Hello from Cyber Range!")

Exit with exit() or press Ctrl + D.

5. Run a Python Script

Create a file called hello.py using the built-in editor:

nano hello.py

Type your code:

print("Hello, World from Cyber Range!")

Save with Ctrl+O → Enter, exit with Ctrl+X, then run:

python3 hello.py

6. Make a Script Executable (Optional)

Add this line to the top of your file:

#!/usr/bin/env python3

Then run:

chmod +x hello.py
./hello.py
Tip: To copy and paste between the Linux Cyber Range and your Windows environment, use Ctrl + Shift + Alt.

Step 2: The Linux Terminal

The command box in Linux is called the Terminal.

Step 3: Basic Linux Commands

1. ls – List Files and Directories

Displays the contents of the current (or specified) directory.

2. cd – Change Directory

Moves you to a different directory.

3. pwd – Print Working Directory

Shows the full path of the directory you are in.

/home/username/Documents

4. cat – Concatenate and Display Files

Displays the contents of a file.

5. nano – Text Editor

Opens a simple editor inside the terminal to create or edit files.

6. history

Displays a list of previously entered commands with line numbers.

*********** Complete these instruction below **********

Click on the link for the Kali Linux virtual machine.

7. Open the Linux Terminal

Once logged in, locate and open the Terminal (command box).

3. Check if Python is Installed

python3 --version

If you see something like Python 3.10.x, Python is ready. If not, contact your instructor.

4. Run Python Interactively

python3

This opens the Python shell. Try typing:

print("Hello from Cyber Range!")

Exit with exit() or press Ctrl + D.

5. Run a Python Script

Create a file called hello.py using the built-in editor:

nano hello.py

Type your code:

print("Hello, World from Cyber Range!")

Save with Ctrl+O → Enter, exit with Ctrl+X, then run:

python3 hello.py

6. Make a Script Executable (Optional)

Add this line to the top of your file:

#!/usr/bin/env python3

Then run:

chmod +x hello.py
./hello.py

Step 8: Commands to Practice

ls -l
ls -a
ls -lh
cd ..
cd /
cd ~
nano PX_lastname_Heading.txt
cat PX_lastname_Heading.txt
history
  

Note: In the nano step, create a file named PX_lastname_Heading.txt and paste in your standard heading. Replace lastname with your actual last name.

Step 5: Assignment Deliverables

  1. Video Recording
    Record yourself running these commands.
    Save as: PX_lastname_basicLinux.mp4
  2. Screenshot
    Take a screenshot of your terminal after using the history command.
    Save as: PX_lastname_basicLinux.png
  • Save your file in your Google Drive under the directory structure Mr. Cusack told you to do.
  • Also, Submit in Google Classroom when Mr. Cusack adds the assignment to google Classroom.
  • ✅ Once you’ve completed both tasks, submit them as instructed.