-
Notifications
You must be signed in to change notification settings - Fork 2
/
console.txt
executable file
·109 lines (61 loc) · 5.17 KB
/
console.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
<p>If I type</p>
<pre>$ figlet absolute beginners</pre>
<p>into my terminal, this is what I get:</p>
<pre> _ _ _
__ _| |__ ___ ___ | |_ _| |_ ___
/ _` | '_ \/ __|/ _ \| | | | | __/ _ \
| (_| | |_) \__ \ (_) | | |_| | || __/
\__,_|_.__/|___/\___/|_|\__,_|\__\___|
_ _
| |__ ___ __ _(_)_ __ _ __ ___ _ __ ___
| '_ \ / _ \/ _` | | '_ \| '_ \ / _ \ '__/ __|
| |_) | __/ (_| | | | | | | | | __/ | \__ \
|_.__/ \___|\__, |_|_| |_|_| |_|\___|_| |___/
|___/
</pre>
<p>Figlet has proved to be a gateway drug for extended terminal usage. Figlet is not on your computer by default though. Even though your mac comes with a lot of unix software already, not a lot of it is graphics software. To install new software you need to install what is called a package manager, hence the aside on the right. This article will continue with an introduction that tells you how to use the terminal!</p>
<p>In your Applications folder, choose Accessories, and open Terminal. Now you can talk with your computer. He can tell you who you are. Type:</p>
<pre>$ whoami</pre>
<p>(without the $ and the space, that’s just a convention to denote text that you enter into the terminal). And press enter. The computer outputs your username! The computer also knows where you are, at least where you are on the hard disk. Enter:</p>
<pre>$ pwd</pre>
<p>And the computer will repond with <code>/Users/yourusername</code>. It would make sense if you could say <code>whereami</code> but consistency is not Unix greatest strength. You are now in what is called your home folder.<br />
You can always return to your home folder by typing:</p>
<pre>$ cd</pre>
<p><code>cd</code> is also the commando to use to go to another folder. You can use the tab button to make this go quicker.<br/>
Type, by example:</p>
<pre>$ cd Do(tab)</pre>
<p>You will see</p>
<pre>Documents/ Downloads/</pre>
<p>Complete further to</p>
<pre>$ cd Doc(tab)</pre>
<p>And your line will be extended to form:</p>
<pre>$ cd Documents/</pre>
<p>When you push enter, you will arrive into the folder Documents. You can check this by again typing</p>
<pre>$ pwd</pre>
<p>To see what files are part of the folder you are in:</p>
<pre>$ ls</pre>
<p>You can also check this in the finder, if you want. You can use the terminal and the finder at the same time. This can make it easier to learn what is going on. You can launch the finder from the terminal.</p>
<pre>open .</pre>
<p><code>.</code> refers to the current folder. <code>open .</code> will open the current folder with the associated program, which is the finder.</p>
<p>To make a new empty file:</p>
<pre>$ touch my_text_file.txt</pre>
<p>If you still have the Finder open, you will see it appear! To open with the text editor:</p>
<pre>$ open mijn_tekst_bestand.txt</pre>
<p>These are the basics of navigating around the terminal.</p>
<div id="aside">
<h3>The homebrew package manager</h3>
<p>We will install <a href="http://mxcl.github.com/homebrew/" title="Homebrew — MacPorts driving you to drink? Try Homebrew!">homebrew</a> to make it easy to install software. One of the upsides to installing homebrew is that you are also forced to install a compiler. A compiler is, like glit says, part of this lifestyle: there are many other ways to install software than through homebrew, but most of them require a working compiler setup.</p>
<p>For homebrew, you need an Intel Mac with OS X 10.5 (Leopard) or newer. To install, we do as instructed on the website: there is a command</p>
<pre>/usr/bin/ruby -e "$(curl -fsSL https://raw.github.com/gist/323731)"</pre>
<p>Now the website doesn’t mention that you need to enter this into the terminal (Oh wait, it does. It didn’t!).<br/>
But that’s what you do. Copy and paste it and press enter.</p>
<p>When the command has run, homebrew tells you to install XCode and Xquartz.</p>
<p>To download XCode for 10.5 or 10.6, you need to become a <a href="http://developer.apple.com/" title="Apple Developer">registered Apple Developer</a>. The site makes it look like you need to pay, but you can register for free.<br/>
For 10.5 you can download Xcode 3.1.4<br/>
For 10.6 can you download Xcode 3.2.6</p>
<p>For 10.7 you can download XCode 4.2 from the App store. This will put a program in your Applications folder that will install XCode. Run this too. Since this version of XCode doesn’t come with the time tested GCC compiler, and some software (such as ffmpeg) will refuse to compile on the newer compiler. That’s why you also need to install GCC, <a href="https://github.com/kennethreitz/osx-gcc-installer#readme">available here</a> (“Pre-built binary”).</p>
<p>With <a href="http://xquartz.macosforge.org/trac/wiki/Releases" title="Releases – XQuartz">XQuartz</a> you install a compatibility layer for Unix software that requires a graphical user interface. Follow the instructions on their website.</p>
<p>With all this installed, you can install your first unix software package: git</p>
<pre>brew install git</pre>
<p>Git is needed to keep your homebrew installation up to date. And now you are all set!</p>
</div>