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

Finish Lab 2

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