Bash Scripting — TryHackMe Walkthrough

📰 Medium · Cybersecurity

Learn Bash scripting fundamentals through a TryHackMe walkthrough, covering commenting code, printing output, and working with variables.

beginner Published 30 Apr 2026
Action Steps
  1. Write a Bash script using a text editor or IDE
  2. Use the # symbol to comment out code at the start of a line
  3. Run the script using the bash command to see the output
  4. Use echo to print text to the screen, such as echo 'Hello World'
  5. Assign and print variables using the = operator and echo command, like city='London' and echo $city
Who Needs to Know This

This walkthrough is beneficial for junior developers, cybersecurity professionals, and anyone interested in learning Bash scripting basics, as it provides a hands-on introduction to essential concepts and techniques.

Key Insight

💡 Bash scripting is a fundamental skill for cybersecurity professionals and developers, and this walkthrough provides a comprehensive introduction to the basics.

Share This
🚀 Learn Bash scripting with TryHackMe! 🚀

Key Takeaways

Learn Bash scripting fundamentals through a TryHackMe walkthrough, covering commenting code, printing output, and working with variables.

Full Article

Title: Bash Scripting — TryHackMe Walkthrough

URL Source: https://medium.com/@owaisalikhan081/bash-scripting-tryhackme-walkthrough-acf9d438cc0c?source=rss------cybersecurity-5

Published Time: 2026-04-30T02:26:52Z

Markdown Content:
# Bash Scripting — TryHackMe Walkthrough | by Owais Ali Khan | Apr, 2026 | Medium

[Sitemap](https://medium.com/sitemap/sitemap.xml)

[Open in app](https://play.google.com/store/apps/details?id=com.medium.reader&referrer=utm_source%3DmobileNavBar&source=post_page---top_nav_layout_nav-----------------------------------------)

Sign up

[Sign in](https://medium.com/m/signin?operation=login&redirect=https%3A%2F%2Fmedium.com%2F%40owaisalikhan081%2Fbash-scripting-tryhackme-walkthrough-acf9d438cc0c&source=post_page---top_nav_layout_nav-----------------------global_nav------------------)

[](https://medium.com/?source=post_page---top_nav_layout_nav-----------------------------------------)

Get app

[Write](https://medium.com/m/signin?operation=register&redirect=https%3A%2F%2Fmedium.com%2Fnew-story&source=---top_nav_layout_nav-----------------------new_post_topnav------------------)

[Search](https://medium.com/search?source=post_page---top_nav_layout_nav-----------------------------------------)

Sign up

[Sign in](https://medium.com/m/signin?operation=login&redirect=https%3A%2F%2Fmedium.com%2F%40owaisalikhan081%2Fbash-scripting-tryhackme-walkthrough-acf9d438cc0c&source=post_page---top_nav_layout_nav-----------------------global_nav------------------)

![Image 1](https://miro.medium.com/v2/resize:fill:32:32/1*dmbNkD5D-u45r44go_cf0g.png)

# Bash Scripting — TryHackMe Walkthrough

[![Image 2: Owais Ali Khan](https://miro.medium.com/v2/da:true/resize:fill:32:32/0*DtGFZwfo4kll3uLz)](https://medium.com/@owaisalikhan081?source=post_page---byline--acf9d438cc0c---------------------------------------)

[Owais Ali Khan](https://medium.com/@owaisalikhan081?source=post_page---byline--acf9d438cc0c---------------------------------------)

Follow

2 min read

·

1 hour ago

[](https://medium.com/m/signin?actionUrl=https%3A%2F%2Fmedium.com%2F_%2Fvote%2Fp%2Facf9d438cc0c&operation=register&redirect=https%3A%2F%2Fmedium.com%2F%40owaisalikhan081%2Fbash-scripting-tryhackme-walkthrough-acf9d438cc0c&user=Owais+Ali+Khan&userId=c70dc4df3cde&source=---header_actions--acf9d438cc0c---------------------clap_footer------------------)

[](https://medium.com/m/signin?actionUrl=https%3A%2F%2Fmedium.com%2F_%2Fbookmark%2Fp%2Facf9d438cc0c&operation=register&redirect=https%3A%2F%2Fmedium.com%2F%40owaisalikhan081%2Fbash-scripting-tryhackme-walkthrough-acf9d438cc0c&source=---header_actions--acf9d438cc0c---------------------bookmark_footer------------------)

[Listen](https://medium.com/m/signin?actionUrl=https%3A%2F%2Fmedium.com%2Fplans%3Fdimension%3Dpost_audio_button%26postId%3Dacf9d438cc0c&operation=register&redirect=https%3A%2F%2Fmedium.com%2F%40owaisalikhan081%2Fbash-scripting-tryhackme-walkthrough-acf9d438cc0c&source=---header_actions--acf9d438cc0c---------------------post_audio_button------------------)

Share

**By Owais Ali Khan**

![Image 3](https://miro.medium.com/v2/resize:fit:301/1*PtFublGNow1r8ZCfgr3_1Q.png)

## Task 2

### Question

> What piece of code can we insert at the start of a line to comment out our code?

### Answer

> #

### Question

> What will the following script output to the screen, echo “BishBashBosh”

### Answer

> BishBashBosh

## Task 3

### Question

> What would this code return?

### Answer

> Jammy is 21 years old

### Question

> How would you print out the city to the screen?

### Answer

> echo $city

### Question

> How would you print out the country to the screen?

### Answer

> echo $country

## Task 4

### Question

> How can we get the number of arguments supplied to a script?

## Get Owais Ali Khan’s stories in your inbox

Join Medium for free to get updates from this writer.

Subscribe

Subscribe

- [x]

Remember me for faster sign in



### Answer

> $#

### Question

> How can we get the
Read full article → ← Back to Reads