Linux Beginner Activity

(Difference between revisions)
Jump to: navigation, search
(Created page with "{| border="1" |- |'''Title''' || Absolute Starting Point to learn Linux Command Line |- |'''Overview''' || |- |'''Author''' || Suzanne Mello-Stark |- |'''Prerequisite Kn...")
 
m
(5 intermediate revisions by 4 users not shown)
Line 10: Line 10:
 
|-
 
|-
 
|'''Learning Objectives''' ||  
 
|'''Learning Objectives''' ||  
 
+
* Learners will begin to gain an understanding of the power of the command line.
 
+
* Learners will know where to get help when its needed.  
Learners will begin to gain an understanding of the power of the command line.
+
* Learners will be able to navigate the Linux file system tree.
Learners will know where to get help when its needed.  
+
Learners will be able to navigate the Linux file system tree.
+
  
 
|}
 
|}
Line 23: Line 21:
 
This activity gives learners a place to explore the Linux command line independent of the Linux distribution installed.
 
This activity gives learners a place to explore the Linux command line independent of the Linux distribution installed.
  
=== Directions: ==
+
=== Directions: ===
 
For this exercise, you are only allowed to use the command line.  Your goal is not to rush through it.   
 
For this exercise, you are only allowed to use the command line.  Your goal is not to rush through it.   
 
The goal is to get comfortable with the command line and understand the commands.  Take your time.  And have fun.
 
The goal is to get comfortable with the command line and understand the commands.  Take your time.  And have fun.
  
Download the following file from [File:animals.zip] and unzip it.  
+
* Download [[Media:Animals.zip | Animals.zip]] and unzip it.  
  
$ unzip animals
+
$ unzip animals
  
If your instructor has stored a tar file (animals.tgz) file locally
+
* If your instructor has stored a tar file (animals.tgz) file locally then you will need to unpack it.  The command in Linux to unpack (unzip) a file is tar.
then you will need to unpack it.  The command in Linux to unpack (unzip) a file is tar.  man tar.
+
  
$ tar zxvf animals.tgz
+
$ tar zxvf animals.tgz
  
Type the following command sequence (the $ is the command prompt):
+
* Type the following command sequence (the $ is the command prompt, so you do not type it):
  
$ pwd
+
$ pwd
$ ls -al
+
$ ls -al
$ cd animals
+
$ cd animals
$ ls
+
$ ls
$ ls -l
+
$ ls -l
$ cd air
+
$ cd air
$ pwd
+
$ pwd
  
Where are you?
+
* Where are you?
 +
* Let's continue traversing the animals directory structure (tree).
 +
* Type the following command sequence:
  
Let's continue traversing the animals directory structure (tree).
+
$ cd ..
Type the following command sequence:
+
$ pwd
 +
$ cd land
 +
$ ls
 +
$ cd ..
 +
$ cd sea
 +
$ pwd
  
$ cd ..
+
* Now where are you?
$ pwd
+
* Using the commands that you just learned, draw out the directory tree from animals on down.
$ cd land
+
$ ls
+
$ cd ..
+
$ cd sea
+
$ pwd
+
  
Now where are you?
+
* Did you understand each command that you typed?
 +
* There is an easy way to look up what each command means. 
 +
* Its called the "man" command, which is short for manual.  In Linux, there is a man page for each command. 
 +
* You just type man followed by the command.  For example:
 +
man ls. 
 +
* Try it now.  You can see all the options that are available for the command.  Everything you could possibly want to know. 
 +
* Take some time to use the man command for all the commands you have used so far.
  
Using the commands that you just learned, draw out the directory tree from animals on down.
+
*Here are some other commands to try.  Look them up as you go along using the man page.
  
Did you understand each command that you typed?
+
$ echo hello
There is an easy way to look up what each command means.  
+
  $ date
Its called the man command. In Linux, there is a man page for each command.  
+
  $ hostname
You just type man followed by the command. For example, man ls.  
+
  $ cal 1492
Try it now. You can see all the options that are available for the command.  Everything you could possibly want to know.   
+
  $ history
Take some time to use the man command for all the commands you have used so far.
+
  $ echo 2+2
 +
  $ echo 2+2 | bc -l
 +
$ clear
 +
$ who
 +
$ man file
 +
$ yes 'help me'  ****sorry about that******** did you figure out how to stop it?
 +
$ top
 +
$ cd
 +
$ cat > message.txt
 +
  $ Linux is fun!
 +
$ [ctrl-d]  ****this is the control d command using your keyboard****
 +
$ ls
 +
$ cat message.txt
  
Here are some other commands to try.  Look them up as you go along using the man page.
+
* Where is your message.txt file saved?
 
+
$ echo hello
+
$ date
+
$ hostname
+
$ cal 1492
+
$ history
+
$ echo 2+2
+
$ echo 2+2 | bc -l
+
$ clear
+
$ who
+
$ man file
+
$ yes 'help me'  ****sorry about that******** did you figure out how to stop it?
+
$ top
+
$ cd
+
$ cat > message.txt
+
$ Linux is fun!
+
$ [ctrl-d]  ****this is the control d command using your keyboard****
+
ls
+
cat message.txt
+
 
+
Where is your message.txt file saved?
+
  
 
Now wasn't that fun?  Using a few commands you just learned, save your history to a text file.   
 
Now wasn't that fun?  Using a few commands you just learned, save your history to a text file.   
 
Hint: Direct (>) the history command into a text file. history > myfile.txt.
 
Hint: Direct (>) the history command into a text file. history > myfile.txt.
 
  
 
=== Deliverables: ===
 
=== Deliverables: ===
Line 142: Line 137:
 
[[File:CC_license.png]]
 
[[File:CC_license.png]]
  
[[Category: Software Engineering]]
+
[[Category: Tools and Environment]]
[[Category: Tools and Environments]]
+
[[Category: Introduction]]

Revision as of 12:47, 27 January 2017

Title Absolute Starting Point to learn Linux Command Line
Overview
Author Suzanne Mello-Stark
Prerequisite Knowledge None
Learning Objectives
  • Learners will begin to gain an understanding of the power of the command line.
  • Learners will know where to get help when its needed.
  • Learners will be able to navigate the Linux file system tree.

Contents

Background:

Learning the Linux command line can be very challenging. There is a lot of material that is already available to learn the Linux command line. This activity gives learners a place to explore the Linux command line independent of the Linux distribution installed.

Directions:

For this exercise, you are only allowed to use the command line. Your goal is not to rush through it. The goal is to get comfortable with the command line and understand the commands. Take your time. And have fun.

$ unzip animals
  • If your instructor has stored a tar file (animals.tgz) file locally then you will need to unpack it. The command in Linux to unpack (unzip) a file is tar.
$ tar zxvf animals.tgz
  • Type the following command sequence (the $ is the command prompt, so you do not type it):
$ pwd
$ ls -al
$ cd animals
$ ls
$ ls -l
$ cd air
$ pwd
  • Where are you?
  • Let's continue traversing the animals directory structure (tree).
  • Type the following command sequence:
$ cd ..
$ pwd
$ cd land
$ ls
$ cd ..
$ cd sea
$ pwd
  • Now where are you?
  • Using the commands that you just learned, draw out the directory tree from animals on down.
  • Did you understand each command that you typed?
  • There is an easy way to look up what each command means.
  • Its called the "man" command, which is short for manual. In Linux, there is a man page for each command.
  • You just type man followed by the command. For example:
man ls.  
  • Try it now. You can see all the options that are available for the command. Everything you could possibly want to know.
  • Take some time to use the man command for all the commands you have used so far.
  • Here are some other commands to try. Look them up as you go along using the man page.
$ echo hello
$ date
$ hostname
$ cal 1492
$ history
$ echo 2+2
$ echo 2+2 | bc -l
$ clear
$ who
$ man file
$ yes 'help me'  ****sorry about that******** did you figure out how to stop it?
$ top
$ cd
$ cat > message.txt 
$ Linux is fun!
$ [ctrl-d]   ****this is the control d command using your keyboard****
$ ls
$ cat message.txt
  • Where is your message.txt file saved?

Now wasn't that fun? Using a few commands you just learned, save your history to a text file. Hint: Direct (>) the history command into a text file. history > myfile.txt.

Deliverables:

Your myfile.txt file is your deliverable to hand into your instructor.

Assessment:

To measure this activity, you can check the history file to be sure all commands are conducted including the man commands.


Comments:

The animals directory tree structure is saved in a zip file. The instructor will need to have students install zip on their machines prior to the activity. Or the instructor will need to create a tar file to download locally and unpack it

Additional Information:

Knowledge Area/Knowledge Unit What ACM Computing Curricula 2013 https://www.acm.org/education/CS2013-final-report.pdf knowledge area and units does this activity cover?
Topic What specific topics are addressed? The Computing Curriucula 2013 provides a list of topics - https://www.acm.org/education/CS2013-final-report.pdf
Level of Difficulty Easy
Estimated Time to Completion 60 minutes
Materials/Environment Access to the LINUX command line. This activity also works on the iOS command line.
Author Suzanne Mello-Stark
Source This is an original activity.
License Licensed CC BY-SA


Suggestions for the Open Source Project:

This activity can be done first before jumping into any Linux based Open Source Project.


This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License

CC license.png

Personal tools
Namespaces
Variants
Actions
Events
Learning Resources
HFOSS Projects
Evaluation
Navigation
Toolbox