Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
nim28-CS265-f19
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nathan Meyer
nim28-CS265-f19
Commits
8f01d4cd
Commit
8f01d4cd
authored
5 years ago
by
Nathan Meyer
Browse files
Options
Downloads
Patches
Plain Diff
Finalize Lab02
parent
de488262
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
lab02/lab02
+0
-55
0 additions, 55 deletions
lab02/lab02
lab02/lab02.md
+209
-0
209 additions, 0 deletions
lab02/lab02.md
with
209 additions
and
55 deletions
lab02/lab02
deleted
100644 → 0
+
0
−
55
View file @
de488262
Q1:
nim28@tux2 CS265> echo 'milk' > list
nim28@tux2 CS265> echo 'cookies' >> list
nim28@tux2 CS265> echo '#!/bin/bash' > Tmp/gotMe.bash
nim28@tux2 CS265> echo -e '\necho "I have no idea."' >> Tmp/gotMe.bash
nim28@tux2 CS265> find . -type f -mtime -2 -print
./GitLab/lab02/lab02
./GitLab/lab01/Tmp/gotMe.bash
./GitLab/lab01/Tmp/list
./GitLab/lab01/list
./GitLab/lab01/lab01.txt
Q2:
find . -type f -name *.bash
Q3:
nim28@tux2 lab02> cp ~kschmidt/public_html/CS265/Labs/Bash/breadIsDangerous.txt ./breadIsDangerous.txt
nim28@tux2 lab02> wc ./breadIsDangerous.txt
97 499 2960 ./breadIsDangerous.txt
nim28@tux2 lab02> ls -1 | wc -l
2
Q4:
ls -1 | wc -l
Q5:
nim28@tux2 lab02> grep -o bread breadIsDangerous.txt
bread
bread
bread
bread
bread
bread
bread
bread
bread
bread
bread
bread
bread
bread
bread
bread
bread
bread
bread
bread
bread
Q6:
nim28@tux2 lab02> grep -o bread breadIsDangerous.txt | wc -l
21
\ No newline at end of file
This diff is collapsed.
Click to expand it.
lab02/lab02.md
0 → 100644
+
209
−
0
View file @
8f01d4cd
# Lab_02
#### <u>Tux Lab</u>
__Q1:__
```
bash
nim28@tux2 CS265>
echo
'milk'
>
list
nim28@tux2 CS265>
echo
'cookies'
>>
list
nim28@tux2 CS265>
echo
'#!/bin/bash'
>
Tmp/gotMe.bash
nim28@tux2 CS265>
echo
-e
'\necho "I have no idea."'
>>
Tmp/gotMe.bash
nim28@tux2 CS265> find
.
-type
f
-mtime
-2
-print
./GitLab/lab02/lab02
./GitLab/lab01/Tmp/gotMe.bash
./GitLab/lab01/Tmp/list
./GitLab/lab01/list
./GitLab/lab01/lab01.txt
```
__Q2:__
`find . -type f -name *.bash`
__Q3:__
```
bash
nim28@tux2 lab02>
cp
~kschmidt/public_html/CS265/Labs/Bash/breadIsDangerous.txt ./breadIsDangerous.txt
nim28@tux2 lab02>
wc
./breadIsDangerous.txt
97 499 2960 ./breadIsDangerous.txt
nim28@tux2 lab02>
ls
-1
|
wc
-l
2
```
__Q4:__
`ls -1 | wc -l`
__Q5:__
```
bash
nim28@tux2 lab02>
grep
-o
bread breadIsDangerous.txt
bread
bread
bread
bread
bread
bread
bread
bread
bread
bread
bread
bread
bread
bread
bread
bread
bread
bread
bread
bread
bread
```
__Q6:__
```
bash
nim28@tux2 lab02>
grep
-o
'the'
breadIsDangerous.txt |
wc
-l
10
```
__Q7:__
```
bash
nim28@tux2 lab02>
cp
~kschmidt/public_html/CS265/Labs/Bash/spellExample spellExample.txt
nim28@tux2 lab02> ispell
-b
spellExample.txt
nim28@tux2 lab02>
ls
-1
breadIsDangerous.txt
lab02
spellExample.txt
spellExample.txt.bak
nim28@tux2 lab02>
```
New Backed up file (.bak)
__Q8:__
```
bash
nim28@tux2 lab02>
echo
"An extra line"
>>
spellExample
nim28@tux2 lab02> diff spellExample.txt spellExample.txt.bak
1c1
< I went to a garden party
---
>
I went to a gadren party
3c3
< bunch of my old friends did something
---
>
bnuch of my old freinds did somehting
nim28@tux2 lab02>
```
Backed up file is not edited, regular file is edited.
__Q9:__
```
bash
nim28@tux2 lab02> diff spellExample.txt spellExample.txt
nim28@tux2 lab02>
```
Nothing
__Q10:__
```
bash
nim28@tux2 lab02>
cp
~kschmidt/public_html/CS265/Labs/Bash/numbers numbers
nim28@tux2 lab02>
sort
numbers
1
15
17
20
24
26
28
29
6
9
nim28@tux2 lab02>
```
Yes, I know sorting defaults to character by character alphabetization.
__Q11:__
```
bash
nim28@tux2 lab02>
sort
-n
numbers
1
6
9
15
17
20
24
26
28
29
nim28@tux2 lab02>
```
Yes, -n means numerical order.
__Q12:__
Outputs in numerical order instead of alphabetical order.
__Q13:__
```
bash
nim28@tux2 lab02>
ls
-oh
|
sort
-k4
-h
-r
-rw-r--r--
1 nim28 2.9K Oct 4 14:34 breadIsDangerous.txt
-rw-rw-r--
1 nim28 962 Oct 4 14:49 lab02
-rw-r--r--
1 nim28 97 Oct 4 14:55 spellExample.txt
-rw-r--r--
1 nim28 97 Oct 4 14:54 spellExample.txt.bak
-rw-r--r--
1 nim28 27 Oct 4 15:05 numbers
-rw-rw-r--
1 nim28 14 Oct 4 15:01 spellExample
total 6.0K
nim28@tux2 lab02>
```
Prints in order of filesize
__Q14:__
```
bash
nim28@tux2 lab02>
du
-a
|
sort
-n
-r
|
head
-n
8
7
.
3 ./breadIsDangerous.txt
1 ./spellExample.txt.bak
1 ./spellExample.txt
1 ./spellExample
1 ./numbers
1 ./lab02
nim28@tux2 lab02>
```
__Q15:__
```
bash
nim28@tux2 lab02>
grep
dough breadIsDangerous.txt
roven that as little as one pound of dough can be used to
5. Bread is made from a substance called
"dough."
It has been
proven that as little as one pound of dough can be used to
nim28@tux2 lab02>
echo
$?
0
nim28@tux2 lab02>
grep
uniqueString breadIsDangerous.txt
nim28@tux2 lab02>
echo
$?
1
nim28@tux2 lab02>
grep
dough noSuchFile
grep
: noSuchFile: No such file or directory
nim28@tux2 lab02>
echo
$?
2
nim28@tux2 lab02>
```
Stdin
Stdout
Stderr
#### <u>Git Lab</u>
__Q 2.1:__
`de488262e6665251da66cb348b2ddf24624ffe1d`
__Q 2.2:__
```
bash
git reset
# Changes position in work tree
git reset
--hard
# Modifies work tree
```
__Q 2.3:__
```
bash
a6a2e69 Most recent commit
f07e105 The cutter commit
dabc8d2 The ketch commit
d51de8e The yawl commit
$
git show dabc8d2:marvin
```
__Q 2.4:__
`goto 2.1`
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment