So u have arrived here to learn Linux, hope this write-up helps u.

Target:

There is no target for some tasks, the purpose is to get hands-on Linux command.

Setting up the environment:

Tryhackme made it easy for u. If u have old computer with small RAM but can reach THM site u can use Linux machine by pressing ”Start AttackBox” .Enjoy it

At this room u’ll find a time-labeled video walking through each task, Don’t rely on it as u ‘ll not see this video every time .Try to search first .

Now u are ready, let’s get our hands dirty

Task 1: Intro

If u want to use THM Linux machine, u can press “”Start AttackBox at the top-right or “Start Machine” from first task.

Task 2: Methodology

Here u are reminded that each section being more complex and requiring knowledge from the previous section, so don’t jump over tasks.

RUNNING COMMANDS

Task 3: Basic command execution:

everything that can be done over SSH is done by running commands .So focus! .Let’s start with echo command .Type echo and

.Hope everything is okay.No weird responses appeared and u see the command line interface (CLI) greeting u and says

Congrats! U should be proud of yourself. Let’s move on to another command.

Task 4: Manual pages and flags

So most of the time u’ll used a command with a special flags .Flags are special letters that modifies how the command works. it’s simplest form is

Are u have to remember every command with its special flags? No .u can leave this mind-hard work to man pages .Try ‘man echo’ and conclude what is shown.

Man command works by inputting the command u want to know what it is after ‘ man’ and it shows u what the command is with all its flags –under description section- with a nicely formatted document.

But should we trust man output? Let us find out .THM asks u to echo ‘hello’ without newline .From man pages and finding out which flags makes the echo command prints with no newline u typed

and it did what u expected, printing ‘hello’ without newline.

BASIC FILE OPERATION

Task 5: ls

ls is a command that lists information about every file/directory in the directory. Just running the ls command outputs the name of every file in the directory.

Remember flags from the last task? How u can find ls command flags? Try to find flags that prints all files /directories including ones that start with

And what flag outputs things in a “long list” format?

Task 6: — cat

cat short for concatenate, does exactly that, it outputs the contents of files to the console.

For example, given a file called a.txt which contains the data “hello”

Would output hello.

  • are u getting bored with man pages? Well, most command support — help that almost do what man pages do

Task 7: — touch

touch is a pretty simple command, it creates files.

Given the command

b.txt would be created.

Task 8: Running a Binary

When you want to run downloaded or user created programs. This is done by providing the full path to the binary, for example say you download a binary that outputs ‘noot’, providing the full path to that binary will execute it

Note: A binary is just executable code, think a windows exe file

Now u are thinking about long-name files and how pain u will face when writing it …. Well, Linux developer have been there before u

U just need to know the relative paths from this chart

  • These shortcuts are for every command, so if u were to run

it would be the same as running

By reviewing the relative paths:

How would you run a binary called hello using the directory shortcut. ? Simply as ./hello

How would you run a binary called hello in your home directory using the shortcut ~? ~/hello

How would you run a binary called hello in the previous directory using the shortcut .. ? using ../hello

Task 9 Binary — Shiba1 :

Now it is time for first simple challenge, create a file called noot.txt.

Once you’re done run the binary and you’ll be given the password for the user shiba2!

The shiba2 file is at current directory so u can type ./shiba2 .

So u have covered the shiba2 password? .. Keep that in mind .

Task 10 su:

su is a command that allows you to change the user, without logging out and logging back in again. For example if you wanted to switch to shiba2 while you’re the user shiba1, you would type

u would then be prompted for a password and if you entered shiba2’s password you would then become shiba2

Note: