
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
- Running Your First few Commands
- Interacting With the Filesystem!
- Searching for Files
- An Introduction to Shell Operators
A Bit of Background on Linux
-
Research: What year was the first release of a Linux operating system?
A quick Google search gives us the answer.
Click for answer
1991
Running Your First few Commands
-
If we wanted to output the text "TryHackMe", what would our command be?
Click for answer
echo TryHackMe -
What is the username of who you're logged in as on your deployed Linux machine?
Type
whoamito find out who you are logged in as.Click for answer
tryhackme
Interacting With the Filesystem!
-
On the Linux machine that you deploy, how many folders are there?
Use
ls -lato find out how many folders are present.Click for answer
4 -
Which directory contains a file?
Use
cdto navigate to each folder and then uselsto find any files.Click for answer
folder4 -
What is the contents of this file?
Read the content of the file using
cat ...txt.Click for answer
Hello World -
Use the cd command to navigate to this file and find out the new current working directory. What is the path?
Use
cdto navigate to the file if not already done. Then usepwdto print the current working directory.Click for answer
/home/tryhackme/folder4
Searching for Files
-
Use grep on "access.log" to find the flag that has a prefix of "THM". What is the flag?
Use the
grepcommand to find any string in a file.cmdgrep "THM" access.logClick for answer
THM{ACCESS}
An Introduction to Shell Operators
-
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
& -
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 answer
echo password123 > passwords -
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 answer
echo tryhackme >> passwords