Skip to content
Snippets Groups Projects
Commit 277623f5 authored by Nathan Meyer's avatar Nathan Meyer
Browse files

Finish Lab 2

parent 8f01d4cd
Branches master
No related tags found
No related merge requests found
# Lab_02
#### <u>Tux Lab</u>
__Q1:__
**Q1:**
```bash
nim28@tux2 CS265> echo 'milk' > list
nim28@tux2 CS265> echo 'cookies' >> list
......@@ -15,10 +15,10 @@ nim28@tux2 CS265> find . -type f -mtime -2 -print
./GitLab/lab01/lab01.txt
```
__Q2:__
**Q2:**
`find . -type f -name *.bash`
__Q3:__
**Q3:**
```bash
nim28@tux2 lab02> cp ~kschmidt/public_html/CS265/Labs/Bash/breadIsDangerous.txt ./breadIsDangerous.txt
nim28@tux2 lab02> wc ./breadIsDangerous.txt
......@@ -27,10 +27,10 @@ nim28@tux2 lab02> ls -1 | wc -l
2
```
__Q4:__
**Q4:**
`ls -1 | wc -l`
__Q5:__
**Q5:**
```bash
nim28@tux2 lab02> grep -o bread breadIsDangerous.txt
bread
......@@ -56,13 +56,13 @@ bread
bread
```
__Q6:__
**Q6:**
```bash
nim28@tux2 lab02> grep -o 'the' breadIsDangerous.txt | wc -l
10
```
__Q7:__
**Q7:**
```bash
nim28@tux2 lab02> cp ~kschmidt/public_html/CS265/Labs/Bash/spellExample spellExample.txt
nim28@tux2 lab02> ispell -b spellExample.txt
......@@ -76,7 +76,7 @@ nim28@tux2 lab02>
New Backed up file (.bak)
__Q8:__
**Q8:**
```bash
nim28@tux2 lab02> echo "An extra line" >> spellExample
nim28@tux2 lab02> diff spellExample.txt spellExample.txt.bak
......@@ -92,14 +92,14 @@ nim28@tux2 lab02>
```
Backed up file is not edited, regular file is edited.
__Q9:__
**Q9:**
```bash
nim28@tux2 lab02> diff spellExample.txt spellExample.txt
nim28@tux2 lab02>
```
Nothing
__Q10:__
**Q10:**
```bash
nim28@tux2 lab02> cp ~kschmidt/public_html/CS265/Labs/Bash/numbers numbers
nim28@tux2 lab02> sort numbers
......@@ -117,7 +117,7 @@ nim28@tux2 lab02>
```
Yes, I know sorting defaults to character by character alphabetization.
__Q11:__
**Q11:**
```bash
nim28@tux2 lab02> sort -n numbers
1
......@@ -134,10 +134,10 @@ nim28@tux2 lab02>
```
Yes, -n means numerical order.
__Q12:__
**Q12:**
Outputs in numerical order instead of alphabetical order.
__Q13:__
**Q13:**
```bash
nim28@tux2 lab02> ls -oh | sort -k4 -h -r
-rw-r--r-- 1 nim28 2.9K Oct 4 14:34 breadIsDangerous.txt
......@@ -151,7 +151,7 @@ nim28@tux2 lab02>
```
Prints in order of filesize
__Q14:__
**Q14:**
```bash
nim28@tux2 lab02> du -a | sort -n -r | head -n 8
7 .
......@@ -164,7 +164,7 @@ nim28@tux2 lab02> du -a | sort -n -r | head -n 8
nim28@tux2 lab02>
```
__Q15:__
**Q15:**
```bash
nim28@tux2 lab02> grep dough breadIsDangerous.txt
roven that as little as one pound of dough can be used to
......@@ -187,16 +187,16 @@ Stderr
#### <u>Git Lab</u>
__Q 2.1:__
**Q 2.1:**
`de488262e6665251da66cb348b2ddf24624ffe1d`
__Q 2.2:__
**Q 2.2:**
```bash
git reset # Changes position in work tree
git reset --hard # Modifies work tree
```
__Q 2.3:__
**Q 2.3:**
```bash
a6a2e69 Most recent commit
f07e105 The cutter commit
......@@ -205,5 +205,5 @@ d51de8e The yawl commit
$ git show dabc8d2:marvin
```
__Q 2.4:__
**Q 2.4:**
`goto 2.1`
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment