/
lab.01.part2.download.compress.txt
178 lines (92 loc) · 3.67 KB
/
lab.01.part2.download.compress.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
LAB 1 PART 2 — revised 8/8/20 (lg)
Part 1 - Paths and Review
==========
Follow the instructions line-by-line.
* Type in the commands as is, but ignore the beginning prompt.
* Enter, tab, up and down are represented by <ENTER><TAB>,<UP> and <DOWN>.
* "No output" or "nothing happens" are valid answers to any of the questions.
Feel free to use your workstation to test your answers to the questions that don't explicitly tell you to run a command)
==========
==========
1. Write the command that you would use to change to the root directory.
----------
==========
2. Write the command that you would use to change to your home directory.
----------
==========
3. What's the absolute path to your Desktop directory?
----------
==========
4. If you're in your home directory, how would you create a new directory on your desktop
called stuff without changing your directory? Write your command below.
----------
==========
5. If you're in your Desktop directory, how would you change to two directories right above it (again, this should be /Users) using a relative path? Write your command below.
----------
==========
6. What's the shortcut for changing to the directory that you were just previously in? For example, if I were in /Volumes... and I changed to /Users/professor/Desktop, what's a quick way of changing to /Volumes without writing something like cd /Volumes?
----------
==========
7. How would you show all of the files (including hidden ones) with detailed (long) information
for all files on your Desktop — if you're currently in your home directory? Write your command below.
----------
==========
Part 2 - Output, Download and Uncompress
==========
Follow the instructions line-by-line.
* Type in the commands as is, but ignore the beginning prompt.
* Enter, tab, up and down are represented by <ENTER><TAB>,<UP> and <DOWN>.
* "No output" or "nothing happens" are valid answers to any of the questions.
We're going to be echoing stuff to the console and cleaning it up.
==========
1. Type:
$ echo hello there
Copy and paste the output below.
----------
==========
2. Type:
$ echo whoa
Copy and paste the output below.
----------
==========
3. Type:
$ echo good mornin'
Copy and paste the output below.
----------
==========
4. Uh-oh... we're stuck!
Type [CTRL + C] to get your prompt back.
----------
==========
5. Say good mornin' again with quotes!
$ echo "good mornin'"
Copy and paste the output below.
----------
==========
6. There are some other symbols that have special meanings if you don't quote them.
For example, > brings up a different prompt. Try *.
$ echo *
What happens?
----------
==========
7. Ok... that's a lot of output. How do we clean up our screen so that it's empty again?
Write the command that you used below:
----------
==========
Downloading files from a web site: We'll use the following method to download more lab materials!
What if I want to save a file from a website?
What flag/option and option argument would I use to download a web page to a file called mygoogle.html?
8. Run the following command *exactly* as it appears:
$ curl -o mygoogle.html www.google.com
Now copy and paste the output below.
----------
==========
9. Now let's download some course-related files. First, figure out what directory you're in.
Write the command you used to determine your directory. Also, copy and paste the output below.
----------
==========
10. If you're not in your home directory, change to it (use the shortcut).
Write the command that you used to change to your home directory.
If you were already in your home directory, write the command that you *would* have used to change to it!
----------
===========