Getting Started with Linux

LinuxLinuxBeginner
Practice Now

Introduction

In this lab, you'll begin an exciting journey into the world of Linux! We'll start with fun and simple commands that will help you get comfortable with the terminal - your window into the Linux world. Think of it as learning to send text messages to your computer! Don't worry if you've never used Linux before; we'll take it one small step at a time.

Everything is set up in your browserโ€”enter the LabEx magic! Simply click the Continue button or the LabEx VM icon on the left to embark on your journey.

kickstart a lab

Skills Graph

%%%%{init: {'theme':'neutral'}}%%%% flowchart RL linux(("`Linux`")) -.-> linux/BasicSystemCommandsGroup(["`Basic System Commands`"]) linux(("`Linux`")) -.-> linux/SystemInformationandMonitoringGroup(["`System Information and Monitoring`"]) linux(("`Linux`")) -.-> linux/PackagesandSoftwaresGroup(["`Packages and Softwares`"]) linux(("`Linux`")) -.-> linux/TextProcessingGroup(["`Text Processing`"]) linux/BasicSystemCommandsGroup -.-> linux/echo("`Text Display`") linux/BasicSystemCommandsGroup -.-> linux/clear("`Screen Clearing`") linux/SystemInformationandMonitoringGroup -.-> linux/date("`Date/Time Displaying`") linux/PackagesandSoftwaresGroup -.-> linux/software("`Linux Software`") linux/TextProcessingGroup -.-> linux/expr("`Evaluate Expressions`") subgraph Lab Skills linux/echo -.-> lab-446315{{"`Getting Started with Linux`"}} linux/clear -.-> lab-446315{{"`Getting Started with Linux`"}} linux/date -.-> lab-446315{{"`Getting Started with Linux`"}} linux/software -.-> lab-446315{{"`Getting Started with Linux`"}} linux/expr -.-> lab-446315{{"`Getting Started with Linux`"}} end

Meeting Your Terminal

In this step, we'll open the terminal and learn how to make your computer talk back to you! The terminal might look simple, but it's like a magic window where you can type commands and see instant results.

First, let's get your terminal ready:

  1. Look at the left side of your screen
  2. Find and click the Xfce Terminal icon (it looks like a small black screen)
  3. A window will open - this is your terminal
Echo Command

Now, let's make your computer say hello! Type this command exactly as shown:

echo "Hello LabEx"

You should see your message appear, like this:

Hello LabEx

๐Ÿ’ซ Tip: Beginners often mistype the command or forget to include the quotes. If an error message appears, use Ctrl + C to clear the terminal and try again.

The echo command is like having a conversation with your computer. Whatever you type after echo is what your computer will say back to you!

Ready to explore more? Click Continue to move to the next step.

Continue to next step arrow

Time and Date Magic

In this step, we'll ask Linux to tell us the time and date. It's like having a smart digital clock in your LabEx environment!

Type this command:

date

You'll see something like this:

Mon Nov 25 01:48:53 PM CST 2024

๐Ÿง™โ€โ™‚๏ธ Command Tip: This shows the current date and time on LabEx VM, it might be different on your local machine.

Want to see a calendar? Try this:

ncal

You'll see a neat calendar of the current month:

    November 2024
Mo Tu We Th Fr Sa Su
             1  2  3
 4  5  6  7  8  9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30

๐ŸŽฏ Quick Challenge: Try showing the whole year in your LabEx terminal:

ncal 2025

Calculator Magic

Let's turn your LabEx terminal into a calculator! You can do math right here.

Try these calculations:

expr 5 + 3

โš ๏ธ Important: Notice the space between numbers and operators, do not type expr 5+3. This is how Linux understands what you want to calculate!

You should see:

8

Let's try more LabEx-themed calculations:

expr 2024 - 2023 ## Years since LabEx launched
expr 24 * 7     ## Hours in a week of learning
expr 60 / 5      ## Minutes to complete this lab

๐ŸŒŸ Fun Fact: Many LabEx users use the terminal as a quick calculator while working on projects!

Playing with Text

Let's have some fun making Linux transform text! We'll use the figlet command to turn text into ASCII art.

Try this:

figlet "LabEx"

You'll see the LabEx name in big ASCII letters:

 _          _     _____      
| |    __ _| |__ | ____|_  __
| |   / _` | '_ \|  _| \ \/ /
| |__| (_| | |_) | |___ >  < 
|_____\__,_|_.__/|_____/_/\_\

Now, try a different message:

figlet -f slant "I Love Linux"

๐Ÿ‘† LabEx Tips: Click "Explain Code" at the bottom right of the code block to chat with Labby AI for code clarification.

The -f parameter used here is a command option in Linux:

  • -f specifies which font style to use
  • slant is a font that creates a slanted text effect

In Linux, you can use man figlet to show the manual page for the figlet command. This page provides detailed information about the command and its options.

Keeping Things Clean

Just like keeping your LabEx workspace organized, you can keep your terminal clean too! When your terminal gets cluttered with text, use:

clear

๐Ÿ’ซ Tip: Professional developers using LabEx often use this command to maintain a clean workspace!

Summary

Congratulations! ๐ŸŽ‰ You've completed your first Linux adventure on LabEx! Let's see what you've learned:

  1. Opening and using the terminal
  2. Making your computer respond with echo
  3. Checking time and calendars with date and ncal
  4. Doing calculations with expr
  5. Creating ASCII art with figlet
  6. Keeping your workspace clean with clear

This is just the beginning of your Linux journey! Want to unlock more exciting commands and professional Linux skills? With LabEx Pro, you get:

LabEx Pro

Ready for your next adventure? Continue with more labs or upgrade to LabEx Pro to accelerate your learning journey!

Other Linux Tutorials you may like