Linux Fundamentals


Getting Started.

This module will take you through the basics of the Linux operating system command line. You will learn how to perform various tasks such as creating files, searching multiple files for content, and deleting files.


Challenges

Before you start this challenge, you should have some understanding of how Linux works.

The Linux Filesystem

In Linux, the filesystem is structured like a tree, starting from the root directory (denoted by the character '/'), which is the base of everything. A 'directory' is just a folder. Think of / as the foundation that holds every file and folder on the system. Here are a few essential directories to get familiar with:

  • / (Root): The top level of the filesystem. All other files and folders are organized underneath it.
  • /home Directory: This is where personal files and folders for each user are stored. Each user has their own folder inside /home, such as /home/username, which is like a private workspace.
  • /tmp Directory: Stores temporary files that are deleted when the machine is restarted. Don't store important things here!

As an example, if you're a Linux user with the account name 'wkiffin', your home directory would be: /home/wkiffin

  • / at the beginning is the root of the directory tree, where all paths start.
  • home is the folder inside '/' that all Linux users home directories are stored.
  • wkiffin is the directory where our specific user files are stored.

Understanding this structure helps you know where to find your files, system settings, and applications on Linux.

In this challenge you will be learning how to traverse the Linux filesystem with the cd command, as well as listing directory content with ls. You can start the VSCode workspace, open a terminal, and run /challenge/solve to get your instructions.

This means you're running a file named 'solve' found within the 'challenge' directory that is held within the root '/' directory!

In this challenge you will be learning how to create files on the command line, and delete files. When you get into the Linux terminal run /challenge/solve to get your instructions.

In this challenge you will be learning how to move, rename, and copy files. When you get into the Linux terminal run /challenge/solve to get your instructions.

In this challenge you will be learning how to display the contents of a file within the linux terminal. When you get into the Linux terminal run /challenge/solve to get your instructions.

In this challenge you will learn how to find files if you don't know where they are. When you get into the Linux terminal run /challenge/solve to get your instructions.

In this challenge you will learn how to find specific pieces of information within a file. And find information when you don't know what file it's in. When you get into the Linux terminal run /challenge/solve to get your instructions.

In this challenge you will learn how to create and remove directories, as well as view hidden files! You can start the VSCode workspace, open a terminal, and run /challenge/solve to get your instructions.

In this challenge you will learn how to find out system information on the command line, as well as how to use flags with commands! You will also find out how to learn a new command you know nothing about! You can start the VSCode workspace, open a terminal, and run /challenge/solve to get your instructions.

Before you start this challenge, you should have some understanding of nano.

Nano Text Editor

In Linux, while you're using the command line, you want a way to edit files. On Windows we can open up notepad, Microsoft Word, or Visual Studio Code. We don't have access to these tools because they are graphical tools. However, the Linux command line offers a wide range of text editors that we can use. One of which is called nano.

You can use Nano by typing the command 'nano' in the terminal. You can then begin writing text to the screen as if you were using notepad on Windows. To move around in nano you can use the arrow keys. The only difference is that you can't use your mouse to click 'file' and then 'save as', you have to use Keyboard shortcuts. You're familiar already with certain keybaord shortcuts such as Ctrl+c to copy, and Ctrl+v to paste.

In nano, they provide you with all of the keyboard shortcuts you will need to use at the bottom of your screen. It shows you the shortcut you need to enter with the syntax of up carrot '^' and then a letter following it. The up carrot ('^') means you have to hold the control key and then hit the letter that follows to execute the proper function. To save a file, you will use the 'Write Out' shortcut to save your file. You will be prompted if you want to "Save modified buffer", you can then hit the 'y' key for yes, then it will ask for a filename at the bottom of the screen. Type the filename you want, and then hit enter. Then to exit, enter the right shortcut to exit that is found at the bottom the screen.

To complete this challenge you use nano to create a file named my_nano_file.txt in your home directory (you should be there by default). This file should contain the phrase "When one does not love too much, one does not love enough." When you have put the text in nano, save it and exit, then run /challenge/solve.

In the previous challenge you saw how to create a file with nano. In this challenge you will see how to edit an existing file. Spoiler Alert: It's easy!

To complete this challenge:

  1. Open the file you created in the previous challenge by typing nano [your_file].
  2. Edit the current line to say anything you want in the file, just change it.
  3. Save, exit, and run /challenge/solve to get your flag.


30-Day Scoreboard:

This scoreboard reflects solves for challenges in this module after the module launched in this dojo.

Rank Hacker Badges Score