Linux 101⚓︎
Difficulty:
Direct link: Objective 3 terminal
Objective⚓︎
Request
Visit Ginger Breddie in Santa's Shack on Christmas Island to help him with some basic Linux tasks. It's in the southwest corner of Frosty's Beach.
Ginger Breddie
Hey, welcome to Santa's Surf Shack on tropical Christmas Island! I'm just hanging ten here, taking it easy while brushing up on my Linux skills.
You ever tried getting into Linux? It's a super cool way to play around with computers.
Solution⚓︎
This challenge provides some introductory practice with performing Linux command line tasks.
Perform a directory listing of your home directory to find a troll and retrieve a present!
Answer
ls
Now find the troll inside the troll:
Answer
cat troll_19315479765589239
Great, now remove the troll in your home directory.
Answer
rm troll_19315479765589239
Print the present working directory using a command.
Answer
pwd
Good job but it looks like another troll hid itself in your home directory. Find the hidden troll!
Answer
ls -la
Excellent, now find the troll in your command history.
Answer
history
Find the troll in your environment variables.
Answer
printenv
Next, head into the workshop.
Answer
cd workshop
A troll is hiding in one of the workshop toolboxes. Use "grep" while ignoring case to find which toolbox the troll is in.
Answer
grep -ir "troll*" .
flags
-i = case-insensitive -r = searches the contents of the specified directory recursively
A troll is blocking the present_engine from starting. Run the present_engine binary to retrieve this troll.
Answer
ls -la present_engine
chmod 555 present_engine
./present_engine
Trolls have blown the fuses in /home/elf/workshop/electrical. cd into electrical and rename blown_fuse0 to fuse0.
Answer
cd electrical
mv blown_fuse0 fuse0
Now, make a symbolic link (symlink) named fuse1 that points to fuse0.
Answer
ln -s fuse0 fuse1
Make a copy of fuse1 and name it fuse2.
Answer
cp fuse1 fuse2
We need to make sure trolls don't come back. Add the characters "TROLL_REPELLENT" into the file fuse2.
Answer
echo "TROLL_REPELLENT" >> fuse2
Find the troll somewhere in /opt/troll_den.
Answer
find /opt/troll_den -iname troll*
Find the file somewhere in /opt/troll_den that is owned by the user troll.
Answer
find /opt/troll_den -user troll
Find the file created by trolls that is greater than 108 kilobytes and less than 110 kilobytes located somewhere in /opt/troll_den.
Answer
find /opt/troll_den -size +108k -size -110k
List running processes to find another troll.
Answer
ps -e
The 14516_troll process is listening on a TCP port. Use a command to have the only listening port display to the screen.
Answer
netstat -tulnp
The service listening on port 54321 is an HTTP server. Interact with this server to retrieve the last troll.
Answer
curl http://0.0.0.0:54321
Your final task is to stop the 14516_troll process to collect the remaining presents.
Answer
kill 15435
Congratulations, you caught all the trolls and retrieved all the presents! Type "exit" to close...
Response⚓︎
Ginger Breddie
Wow, if your surfing skills are as good as your Linux skills, you could be winning competitions!