Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision |
classes:psyc410_s15:unix [2014/12/26 14:35] – admin | classes:psyc410_s15:unix [2014/12/26 19:50] (current) – removed admin |
---|
====== Getting started with the Mac Terminal ====== | |
| |
The Mac operating system is a Unix-based on graphical user interface. You can therefore interact with your Mac computer using many (most) of the same commands used in Unix/Linux systems. Many of these commands achieve the same things that you can achieve using 'point and click' methods. For instance, if you wanted to create a new folder on your Mac desktop you could click on your desktop, select ''File'' > ''New Folder''. But you can also create a new folder using Unix commands in Mac's ''**Terminal.app**'' (which can be found in ''Applications/Utilities/Terminal''). This will open a "command line" interface (meaning that you interact with the computer by typing out commands rather than pointing and clicking with your mouse/trackpad). By typing the following commands (press enter/return after each line) you will change the directory of your command-line interface to your desktop and create a new folder entitled "mynewfolder" | |
<code> | |
cd ~/Desktop | |
mkdir mynewfolder | |
</code> | |
| |
At this point you are undoubtedly thinking "It was way easier to just use the trackpad, so why would I ever want to use the command-line!?" However, the command-line gives you direct control over many aspects of your computer that would be hard (or impossible) to access via the graphical interface. More importantly for our purposes, we can write our commands into a text file and then tell the computer to read the commands from that file (this file is called a "bash script" because the particular Unix language that we'll be using is called "bash".) This is great because it means that every time we do whatever task we've "scripted", we can be certain that we're doing it //exactly// the same way we did it last time. Moreover, if we need to create 100 new folders we can just tell the computer to read the bash script 100 times. Imagine creating those same 100 new folders by pointing and clicking! | |
| |
*[[http://snap.nlc.dcccd.edu/learn/idaho/unixindex.html|UNIX Introduction]] | |
*[[http://www.ee.surrey.ac.uk/Teaching/Unix/|UNIX Tutorial]] | |
*[[http://unixhelp.ed.ac.uk/|UNIX Help]] | |
*[[http://www.linux.org/lessons/beginner/toc.html|Linux.org tutorial]] | |
*[[http://www.linux-tutorial.info/|Linux tutorial - includes glossary and forums]] | |
*[[http://articles.techrepublic.com.com/5100-10878_11-5827311.html|Top 10 bash shell tips]] | |