Intro to Bash (Activity)

From Foss2Serve
(Difference between revisions)
Jump to: navigation, search
(Created page with "__NOTOC__ {| border="1" |- |'''Title''' || Bash Activity |- |'''Overview''' || Students issue commands and observer their results. |- |'''Prerequisite Knowledge''' || ...")
 
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
{| border="1"
 
|-
 
|'''Title''' ||  Bash Activity
 
|-   
 
|'''Overview''' ||  Students issue commands and observer their results.
 
|-
 
|'''Prerequisite Knowledge''' ||  None
 
|-
 
|'''Learning Objectives''' ||  Use a bash terminal to...
 
  
 +
{{Learning Activity Overview
 +
|title=
 +
Bash Activity
 +
|overview=
 +
Students issue commands and observer their results.
 +
|prerequisites=
 +
None
 +
|objectives=
 +
Use a bash terminal to...
 
* Create files
 
* Create files
 
* Delete files
 
* Delete files
Line 21: Line 21:
 
* Use `..` to navigate a filesystem
 
* Use `..` to navigate a filesystem
 
* Get help
 
* Get help
 +
|process skills=
 +
}}
  
|}
+
=== Background ===
 
+
=== Background: ===
+
 
+
=== Directions: ===
+
  
 +
=== Directions ===
  
 
==== Filesystem ====
 
==== Filesystem ====
Line 70: Line 69:
 
# What does `..` mean in `cd ..`?
 
# What does `..` mean in `cd ..`?
 
# When do you use `rm -r A` instead of `rm A`?
 
# When do you use `rm -r A` instead of `rm A`?
 
  
  
Line 77: Line 75:
 
Run each statement below in a bash terminal. Then answer the questions below (or as you go).
 
Run each statement below in a bash terminal. Then answer the questions below (or as you go).
  
<nowiki>
+
<nowiki>
 
man
 
man
 
man man # Press `space` to page down, `b` to go back, `q` to quit.
 
man man # Press `space` to page down, `b` to go back, `q` to quit.
Line 90: Line 88:
  
  
 
+
=== Deliverables ===
=== Deliverables: ===
+
  
 
Answer to questions.
 
Answer to questions.
  
=== Assessment: ===
+
=== Assessment ===
 
+
=== Comments: ===
+
 
+
=== Additional Information: ===
+
{| border="1"
+
|-
+
|'''Knowledge Area/Knowledge Unit''' || 
+
|-
+
|'''Topic''' || 
+
|-
+
|'''Level of Difficulty''' ||  Beginner
+
|-
+
|'''Estimated Time to Completion''' || 20-30 min
+
|-
+
|'''Materials/Environment''' || Bash shell.
+
|-
+
|'''Author''' ||  Stoney Jackson
+
|-
+
|'''Source''' ||
+
|-
+
|'''License''' ||  CC BY-SA 4.0
+
|}
+
 
+
 
+
=== Suggestions for the Open Source Project: ===
+
  
--------------------
+
=== Comments ===
This work is licensed under a
+
[http://creativecommons.org/licenses/by-sa/4.0/ Creative Commons Attribution-ShareAlike 4.0 International License]
+
  
[[File:CC_license.png]]
+
{{Learning Activity Info
 +
|acm unit=
 +
|acm topic=
 +
|difficulty=
 +
Beginner
 +
|time=
 +
20-30 min
 +
|environment=
 +
Bash shell
 +
|author=
 +
Stoney Jackson
 +
|source=
 +
|license=
 +
{{License CC BY SA}}
 +
}}
  
[[Category: Learning_Activity]]
+
=== Suggestions for the Open Source Project ===
[[Category:Communication_and_Tools]]
+
[[Category:Learning Activity]]
 +
[[Category:Communication and Tools]]
 +
[[Category:CS1]]
 +
[[Category:Good Draft]]

Latest revision as of 00:28, 8 September 2018


Title

Bash Activity

Overview

Students issue commands and observer their results.

Prerequisites

None

Learning
Objectives
After successfully completing this activity, the learner should be able to:

Use a bash terminal to...

  • Create files
  • Delete files
  • Move files
  • Rename files
  • Create directories
  • Delete directories
  • View the contents of a directory
  • Change directories
  • Explain the meaning of the special file `..`
  • Use `..` to navigate a filesystem
  • Get help
Process Skills
Practiced


Background

Directions

Filesystem

Run each statement below in a bash terminal. Then answer the questions below (or as you go).

	ls
	touch f1
	ls
	mv f1 f2
	ls
	cp f2 f1
	ls
	rm f2
	ls
	mkdir d1
	mv f1 d1
	ls
	ls d1
	pwd
	cd d1
	pwd
	ls
	cd ..
	pwd
	ls
	rm d1	# fails
	rm -r d1

  1. What does `ls` display?
  2. What does `mv A B` do if `B` ___is not___ a directory?
  3. What does `mv A B` do if `B` is a directory?
  4. What does `cp A B` do if `B` ___is not___ a directory?
  5. What does `rm A` do if `A` is a file?
  6. What does `mkdir A` do?
  7. What does `pwd` display?
  8. What does `ls A` display if `A` is a directory?
  9. What does `cd A` do?
  10. What does `cd ..` do?
  11. What does `..` mean in `cd ..`?
  12. When do you use `rm -r A` instead of `rm A`?


Getting Help

Run each statement below in a bash terminal. Then answer the questions below (or as you go).

man man man # Press `space` to page down, `b` to go back, `q` to quit. man ls man cd # Unexpected result. help cd

  1. What does `man` do?
  2. What does `help` do?
  3. Use `man` to confirm answers in previous section.


Deliverables

Answer to questions.

Assessment

Comments

ACM BoK
Area & Unit(s)
ACM BoK
Topic(s)
Difficulty

Beginner

Estimated Time
to Complete

20-30 min

Environment /
Materials

Bash shell

Author(s)

Stoney Jackson

Source
License

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

CC license.png


Suggestions for the Open Source Project

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