0% found this document useful (0 votes)
5 views3 pages

Lab Echo, CD, LS, and PWD

Uploaded by

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

Lab Echo, CD, LS, and PWD

Uploaded by

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

Lab: Exploring Basic Linux Commands - echo, cd, ls, and pwd

Objective
Students will gain hands-on experience using the essential Linux commands echo,
cd, ls, and pwd. These commands are fundamental for navigating the file system,
displaying information, and managing files.
Equipment/Tools Needed
 Computer with Linux installed (physical or virtual machine)
 Terminal application

Content
1. Introduction to Commands
o echo: Displays text or variables.

o cd: Changes directories.

o ls: Lists the contents of a directory.

o pwd: Shows the current directory’s full path.

Step-by-Step Guide
Step 1: Using echo (Display Text)
1. Open your terminal.
2. Type the following command to display a simple message:
echo "Hello, Linux!"
o Expected output: Hello, Linux!

3. To create a file with some text, type:


echo "This is a test file." > testfile.txt
o This will create a new file called testfile.txt with the content "This is a
test file."
4. To display the value of an environment variable (e.g., your home directory),
type:
echo $HOME
o Expected output: something like /home/username.

Step 2: Using cd (Change Directory)


1. In your terminal, type the following to navigate to your home directory:
cd ~
2. List the files in the home directory:
ls
3. Navigate to a different directory, e.g., /etc (or any other directory you want to
explore):
cd /etc
4. To go back to the previous directory, use:
cd -
5. Navigate up one directory level:
cd ..
6. To return to the root directory, type:
cd /
Step 3: Using ls (List Files)
1. List the files in the current directory:
ls
2. To list all files, including hidden files, type:
ls -a
3. To see detailed information about files (permissions, ownership, size, etc.),
type:
ls -l
4. To list files with human-readable file sizes (KB, MB), type:
ls -lh
5. Try combining options, for example, listing all files with detailed information:
ls -la
Step 4: Using pwd (Print Working Directory)
1. Type pwd to show your current directory's full path:
pwd
o Expected output: something like /home/username

2. After changing directories with cd, use pwd again to confirm your current
location.
cd /etc
pwd
o Expected output: /etc

Key Deliverables
 A log of all commands you used during the exercise.
 A brief explanation (200-300 words) of what each command does and how
it’s useful in Linux administration.
 A screenshot or copy of the outputs where applicable (e.g., results of ls -l or
pwd commands).

Rubric

Criteria Excellent (5) Good (4) Fair (3) Poor (1-2)

All commands
Minor errors in Multiple errors
used correctly, Some incorrect
Command command usage, in commands
with usage, limited
Accuracy but clear or unclear
appropriate understanding.
understanding. usage.
results.

Incomplete
Completed all Completed most Completed basic
Hands-On tasks or
tasks with clear tasks with few tasks, but left
Completion unclear
results. issues. out some steps.
execution.

Detailed
explanation of
Understandin Basic Poor or
how each Clear explanation
g of explanation, incomplete
command with minor gaps.
Commands lacks depth. explanation.
works and its
utility.

Well-organized
Basic log with
Documentatio log with all Organized but Disorganized
some missing
n commands and with minor gaps. or missing log.
details.
outputs.

Clear and
insightful Good reflection Limited
Minimal or no
Reflection reflection on with some reflection, lacks
reflection.
command insights. depth.
usage.

You might also like