Skip to content

Linux Fundamentals Part 1 Banner

Linux Fundamentals Part 1 Logo

Linux Fundamentals Part 1

This guide contains the answer and steps necessary to get to them for the Linux Fundamentals Part 1 room.

Table of contents

A Bit of Background on Linux

  1. Research: What year was the first release of a Linux operating system?

A quick Google search gives us the answer.

Click for answer1991

Running Your First few Commands

  1. If we wanted to output the text "TryHackMe", what would our command be?

Click for answerecho TryHackMe

  1. What is the username of who you're logged in as on your deployed Linux machine?

Type whoami to find out who you are logged in as.

Click for answertryhackme

Interacting With the Filesystem!

  1. On the Linux machine that you deploy, how many folders are there?

Use ls -la to find out how many folders are present.

Click for answer4

  1. Which directory contains a file?

Use cd to navigate to each folder and then use ls to find any files.

Click for answerfolder4

  1. What is the contents of this file?

Read the content of the file using cat ...txt.

Click for answerHello World

  1. Use the cd command to navigate to this file and find out the new current working directory. What is the path?

Use cd to navigate to the file if not already done. Then use pwd to print the current working directory.

Click for answer/home/tryhackme/folder4

Searching for Files

  1. Use grep on "access.log" to find the flag that has a prefix of "THM". What is the flag?

Use the grep command to find any string in a file.

grep "THM" access.log

Click for answerTHM{ACCESS}

An Introduction to Shell Operators

  1. If we wanted to run a command in the background, what operator would we want to use?

The & operator allows you to run a command in the backgroun.

Click for answer&

  1. If I wanted to replace the contents of a file named "passwords" with the word "password123", what would my command be?

To replace the contents of a file, use the > operator.

Click for answerecho password123 > passwords

  1. Now if I wanted to add "tryhackme" to this file named "passwords" but also keep "passwords123", what would my command be

To add text to a file without deleting anything, us the >> operator.

Click for answerecho tryhackme >> passwords