KEMBAR78
Week - 1 - Linux - Basic - Commands - Exercises 1 | PDF | Operating System | Computer Programming
0% found this document useful (0 votes)
72 views3 pages

Week - 1 - Linux - Basic - Commands - Exercises 1

This document provides a series of exercises aimed at familiarizing users with common Linux terminal commands. Each exercise includes a command to be typed in the terminal, along with questions to enhance understanding of the command's output. The exercises cover various topics such as viewing the calendar, checking system information, and managing files.

Uploaded by

Zaakirah Motara
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
72 views3 pages

Week - 1 - Linux - Basic - Commands - Exercises 1

This document provides a series of exercises aimed at familiarizing users with common Linux terminal commands. Each exercise includes a command to be typed in the terminal, along with questions to enhance understanding of the command's output. The exercises cover various topics such as viewing the calendar, checking system information, and managing files.

Uploaded by

Zaakirah Motara
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Linux Terminal Practice Exercises

Intro to Linux

Objective
These exercises are designed to introduce you to common Linux terminal commands. Follow each prompt
in your terminal and observe the output. Try to understand what each command does.

Instructions
Open a terminal window. Type each command as instructed, then answer any related questions or perform
the tasks as required.

Exercises
1. View the Calendar
• Command: cal
• What month and year is displayed?
2. Clear the Screen
• Command: clear
• What happens in your terminal window?
3. Show the Current Date and Time
• Command: date
• What day of the week is today?
4. Display a Custom Message
• Command: echo "Welcome to Linux!"
• Try replacing the message with your name.
5. Show the Hostname
• Command: hostname
• What hostname is shown?
6. View System Uptime
• Command: uptime
• How long has the system been running?
7. Display Your Current Directory
• Command: pwd
• What is your current directory path?

1
8. List Files and Directories
• Command: ls
• What items are listed?
9. View CPU Information

• Command: lscpu
• What is the model name of the CPU?
10. Show Free Memory
• Command: free -h
• How much free memory is available?
11. Print Kernel and OS Info
• Command: uname -a
• What kernel version do you see?

12. Review Command History


• Command: history
• What was the first command you entered today?

13. Echo a Variable


• Run:
MYNAME="Student"
echo "Hello, $MYNAME"
• Change the value of MYNAME and try again.

14. List Files in Long Format


• Command: ls -l
• What additional information is shown?
15. List All Files, Including Hidden

• Command: ls -a
• What files begin with a dot (.)?
16. Print a Blank Line, Then a Message

• Command:
echo ""
echo "This is a new line"
17. Combine Commands

• Command: echo "Today is:" && date


• What output do you see?
18. Try an Invalid Command
• Type: blahblah
• What error message do you receive?

2
19. Run passwd
• This changes your login password.
20. Exit the Terminal (Last Step)
• Command: exit
• Close your terminal after completing all exercises.

Challenge (Optional)
Try combining a few commands in one line:
clear && echo "System Info:" && uname -a && uptime

You might also like