Command Line: Linux Shell (TryHackMe)

In this article, I will write a write-up for the Linux Shell that covers Interacting With a Shell, Types of Linux Shells, Shell Scripting and Components, The Locker Script and a Practical Exercise at the end.
Who is the facilitator between the user and the OS?
ShellWhat is the default shell in most Linux distributions?
BashWhich command utility is used to list down the contents of a directory?
lsWhich command utility can help you search for anything in a file?
grepWhich shell comes with syntax highlighting as an out-of-the-box feature?
FishWhich shell does not have auto spell correction?
BashWhich command displays all the previously executed commands of the current session?
historyWhat is the shebang used in a Bash script?
#!/bin/bashWhich command gives executable permissions to a script?
chmod +xWhich scripting functionality helps us configure iterative tasks?
loopsWhat would be the correct PIN to authenticate in the locker script?
7385
Practical Exercise
We have placed a script on the default user directory
/home/userof the attached Ubuntu machine. This script searches for a specific keyword in all the files (with .log extension) in a specific directory.Note: Some changes are required inside the script file before you execute it. When you open the machine according to the instructions in task #2, you will be able to gain the session as a normal user. However, we recommend you to become the root user in order to search for the flag in all the files of the given directory. To become one, you only need to type the following command and enter the password of the user:
Become Root User
user@ubuntu:~$ sudo su[sudo] password for user: root@tryhackme:/home/user#You can make the changes in the script file by keeping in view the following details:
Flag: thm-flag01-script
Directory: /var/log
Hint: Look for empty double quotes " " inside the script file and fill them. Make sure not to leave any space between them.
Answer the questions below
- Which file has the keyword?
authentication.log
The image below answers the next questions 12 & 13
First you’ll get to **
/home/userthen you’llcd ../..then you’llcd** /var/logwhen you run ls you’ll see a lot of files that end with .log, you can open each with
nano filename.logbut remember the hint of the flag and something about a cat sleeping

- Where is the cat sleeping?
under the table
Thank you for reading my article. Please leave any questions or comments on improving my learning journey and the THM challenges.




