Skip to main content

Command Palette

Search for a command to run...

My First Steps in Linux – Lessons from TryHackMe’s Linux Fundamentals

Published
5 min read

I’ve been working through TryHackMeLinux Fundamentals and it’s been a great mix of learning commands, exploring the filesystem, and understanding how to work efficiently from the terminal. If you’ve only ever used Windows or Mac, Linux can feel like a completely different world – but the more you use it, the more powerful and natural it becomes.

Where Linux Is Used

Before even touching the terminal, I learned just how common Linux really is. It’s running behind the scenes in:

  • Websites you visit

  • Car entertainment/control systems

  • Point-of-Sale registers

  • Critical infrastructure like traffic lights and industrial controllers

Because Linux is open-source, there are many different “flavours” or distributions, such as Ubuntu and Debian. Each is tailored for different uses, from web servers to personal desktops. In this training, we’re using Ubuntu.

My First Linux Machine

The training provided an in-browser Linux machine so I could learn without installing anything. The terminal might feel intimidating at first, but starting with a few simple commands makes a big difference.

  • `echo` – outputs text to the terminal.
    Example:

      echo Hello
      echo "Hello Friend!"
    
    • `whoami` – shows the username of the logged-in user.

Navigating the Filesystem

The next step was learning how to move around and understand where I am in the system.

  • `ls` – lists files and folders in the current directory.

      ls
      ls Pictures
    
  • `cd` – changes the current directory.

      cd Documents
    
  • `pwd` – prints the full path of the current directory.

      /home/ubuntu/Documents
    

Viewing Files

Once you can find files, you’ll want to see what’s inside them. That’s where `cat` comes in.

  • `cat` – outputs the contents of a file.

      cat todo.txt
      cat /home/ubuntu/Documents/todo.txt
    

Finding Files

When you’re not sure where a file is, manually searching through folders can be a pain. The `find` command solves this.

  • Search by name:

      find -name passwords.txt
    
  • Search by file extension:

      find -name *.txt
    

    Searching Inside Files

    Knowing where a file is doesn’t always mean you can find what you need inside it. That’s where `grep` shines.

    Example: Searching an access log for a specific IP address:

      grep "81.143.211.90" access.log
    

This instantly filters out only the matching lines.

Useful Operators

Linux operators make commands even more flexible:

  • `&` – run a command in the background so you can keep working.

  • `&&` – run one command after another only if the first succeeds.

  • `>` – redirect output to a file, overwriting it.

  • `>>` – append output to a file without overwriting.

Examples:

echo hello > file.txt   # overwrite file.txt
echo world >> file.txt  # append to file.txt

Remote Connections with SSH

I also learned about SSH (Secure Shell), which lets you connect to another machine securely over the internet. It encrypts everything sent between devices so no one can read it in transit.

The basic connection syntax is:

ssh username@IP_address

You then enter the password for that user to gain access to the remote system.

Using Flags and Switches

Commands in Linux can be modified with flags (or switches) to change their behaviour.
Example with `ls`:

  • Default:

      ls
    

    Lists visible files and directories.

  • With `-a`:

      ls -a
    

    Shows all files, including hidden ones (those starting with a dot `.`).

Most commands have a `--help` flag to display all available options:

ls --help

Manual Pages (`man`)

Linux also provides manual pages with detailed command documentation:

man ls

The manual includes a description, usage examples, and all possible options for the command. You can scroll with the arrow keys and exit with `q`.

Beginner-Friendly Linux Command Reference Table

CommandDescriptionExample
`echo`Prints text to the terminalecho "Hello World"
`whoami`Shows current logged-in userwhoami
`ls`Lists files/folders in current directoryls
`ls -a`Lists all files, including hidden onesls -a
`cd`Changes directorycd Documents
`pwd`Prints the full path of the current directorypwd
`cat`Displays file contentscat notes.txt
`find`Searches for files/foldersfind -name file.txt
`grep`Searches inside files for a patterngrep "keyword" file.txt
`&`Runs command in backgroundlongtask &
`&&`Runs next command only if previous succeedscmd1 && cmd2
`>`Redirects output to file (overwrite)echo hi > file.txt
`>>`Redirects output to file (append)echo bye >> file.txt
`man`Opens the manual page for a commandman ls
`--help`Shows help for a commandls --help

Wrapping Up

After completing these sections, I now feel comfortable with:

  • Basic navigation (`ls`, `cd`, `pwd`)

  • Viewing files (`cat`)

  • Finding files (`find`)

  • Searching inside files (`grep`)

  • Using operators for efficiency (`&`, `&&`, `>`, `>>`)

  • Connecting remotely via SSH

  • Leveraging flags and manual pages for command mastery

This is only the first stage of my Linux learning path, but these basics already make me far more confident in navigating and controlling a Linux system – an essential skill for cybersecurity, system administration, and development.

More from this blog

Andrii’s CyberSec Journey

16 posts