Using Macs and Unix Nancy Griffeth January 6, 2014 Funding for this workshop was provided by the...
-
Upload
marshall-booker -
Category
Documents
-
view
214 -
download
0
Transcript of Using Macs and Unix Nancy Griffeth January 6, 2014 Funding for this workshop was provided by the...
![Page 1: Using Macs and Unix Nancy Griffeth January 6, 2014 Funding for this workshop was provided by the program “Computational Modeling and Analysis of Complex.](https://reader035.fdocuments.net/reader035/viewer/2022062716/56649dc75503460f94abcd5b/html5/thumbnails/1.jpg)
Using Macs and UnixNancy Griffeth
January 6, 2014
Funding for this workshop was provided by the program “Computational Modeling and Analysis of Complex
Systems,” an NSF Expedition in Computing (Award Number 0926200).
![Page 2: Using Macs and Unix Nancy Griffeth January 6, 2014 Funding for this workshop was provided by the program “Computational Modeling and Analysis of Complex.](https://reader035.fdocuments.net/reader035/viewer/2022062716/56649dc75503460f94abcd5b/html5/thumbnails/2.jpg)
Outline
Switch 101: Switching from a PC to a Mac:
Introduction to Unix
![Page 3: Using Macs and Unix Nancy Griffeth January 6, 2014 Funding for this workshop was provided by the program “Computational Modeling and Analysis of Complex.](https://reader035.fdocuments.net/reader035/viewer/2022062716/56649dc75503460f94abcd5b/html5/thumbnails/3.jpg)
Exercises
Run Safari (or Chrome or Firefox) Run Microsoft Word or Powerpoint Find a pdf file containing the word
“CMACS” and open it What program was used to open it? Look at all the open programs and
activate the Word program Put the RuleBender application icon in
the Dock
![Page 4: Using Macs and Unix Nancy Griffeth January 6, 2014 Funding for this workshop was provided by the program “Computational Modeling and Analysis of Complex.](https://reader035.fdocuments.net/reader035/viewer/2022062716/56649dc75503460f94abcd5b/html5/thumbnails/4.jpg)
Mac OS X: A Geek with a Pretty (Inter)Face
![Page 5: Using Macs and Unix Nancy Griffeth January 6, 2014 Funding for this workshop was provided by the program “Computational Modeling and Analysis of Complex.](https://reader035.fdocuments.net/reader035/viewer/2022062716/56649dc75503460f94abcd5b/html5/thumbnails/5.jpg)
Mac OS X: A Geek with a Pretty (Inter)Face
![Page 6: Using Macs and Unix Nancy Griffeth January 6, 2014 Funding for this workshop was provided by the program “Computational Modeling and Analysis of Complex.](https://reader035.fdocuments.net/reader035/viewer/2022062716/56649dc75503460f94abcd5b/html5/thumbnails/6.jpg)
Mac OS X: A Geek with a Pretty (Inter)Face
![Page 7: Using Macs and Unix Nancy Griffeth January 6, 2014 Funding for this workshop was provided by the program “Computational Modeling and Analysis of Complex.](https://reader035.fdocuments.net/reader035/viewer/2022062716/56649dc75503460f94abcd5b/html5/thumbnails/7.jpg)
Mac OS X: A Geek with a Pretty (Inter)Face
![Page 8: Using Macs and Unix Nancy Griffeth January 6, 2014 Funding for this workshop was provided by the program “Computational Modeling and Analysis of Complex.](https://reader035.fdocuments.net/reader035/viewer/2022062716/56649dc75503460f94abcd5b/html5/thumbnails/8.jpg)
Introduction to Unix
Everything is a file The file system is organized into a hierarchy A fully-specified path specifies all the directories
from the root to the file, for example: /Users/nancyg/Documents/ABBREV.csv
The working directory or current directory is the one you are working in
A relative path specifies the directories starting with one contained in the working directory:Documents/ABBREV.csv
![Page 9: Using Macs and Unix Nancy Griffeth January 6, 2014 Funding for this workshop was provided by the program “Computational Modeling and Analysis of Complex.](https://reader035.fdocuments.net/reader035/viewer/2022062716/56649dc75503460f94abcd5b/html5/thumbnails/9.jpg)
Getting help
help: displays information about builtin commands (a subset of all commands)
man or info: display a manual page for a command
![Page 10: Using Macs and Unix Nancy Griffeth January 6, 2014 Funding for this workshop was provided by the program “Computational Modeling and Analysis of Complex.](https://reader035.fdocuments.net/reader035/viewer/2022062716/56649dc75503460f94abcd5b/html5/thumbnails/10.jpg)
The file hierarchy
The root file is “/” Some directories below root are:
Applications Developer Library Users bin etc
![Page 11: Using Macs and Unix Nancy Griffeth January 6, 2014 Funding for this workshop was provided by the program “Computational Modeling and Analysis of Complex.](https://reader035.fdocuments.net/reader035/viewer/2022062716/56649dc75503460f94abcd5b/html5/thumbnails/11.jpg)
Manipulating Files
ls pwd cd
mkdir rmdir
mv cp cat rm
open
![Page 12: Using Macs and Unix Nancy Griffeth January 6, 2014 Funding for this workshop was provided by the program “Computational Modeling and Analysis of Complex.](https://reader035.fdocuments.net/reader035/viewer/2022062716/56649dc75503460f94abcd5b/html5/thumbnails/12.jpg)
Manipulating Files: ls options
-a: list *all* files (including . and ..)
-d: print directories as normal files (no contents)
–G: colorize output
-l: long format (access options, time, size)
-t: sort by time modified (most recent first)
![Page 13: Using Macs and Unix Nancy Griffeth January 6, 2014 Funding for this workshop was provided by the program “Computational Modeling and Analysis of Complex.](https://reader035.fdocuments.net/reader035/viewer/2022062716/56649dc75503460f94abcd5b/html5/thumbnails/13.jpg)
Exercises
Use man to learn about ls, cd, pwd What directories are contained in the root directory
(“/”) What non-directory files are contained in the root
directory? What is your home directory? What directories are contained in your home
directory? Use man to learn about mkdir, rmdir
Create a subdirectory of your home directory Create a subdirectory of the subdirectory
![Page 14: Using Macs and Unix Nancy Griffeth January 6, 2014 Funding for this workshop was provided by the program “Computational Modeling and Analysis of Complex.](https://reader035.fdocuments.net/reader035/viewer/2022062716/56649dc75503460f94abcd5b/html5/thumbnails/14.jpg)
Exercises
Use man to learn about mv, cp, cat, rm Create a file containing your name in your
home directory Create a subdirectory of your home
directory Copy the file to the subdirectory Remove the original file Move the copy back to the home directory
![Page 15: Using Macs and Unix Nancy Griffeth January 6, 2014 Funding for this workshop was provided by the program “Computational Modeling and Analysis of Complex.](https://reader035.fdocuments.net/reader035/viewer/2022062716/56649dc75503460f94abcd5b/html5/thumbnails/15.jpg)
Exercises
Use man to learn about “open” Run Safari by opening the appropriate file
![Page 16: Using Macs and Unix Nancy Griffeth January 6, 2014 Funding for this workshop was provided by the program “Computational Modeling and Analysis of Complex.](https://reader035.fdocuments.net/reader035/viewer/2022062716/56649dc75503460f94abcd5b/html5/thumbnails/16.jpg)
Inspecting and Changing Files
more less cat
Editors nano vi emacs
![Page 17: Using Macs and Unix Nancy Griffeth January 6, 2014 Funding for this workshop was provided by the program “Computational Modeling and Analysis of Complex.](https://reader035.fdocuments.net/reader035/viewer/2022062716/56649dc75503460f94abcd5b/html5/thumbnails/17.jpg)
Exercises
Use man to learn about more, less, cat Try using more, less, and cat to look at
files. What are the differences? Use man to learn about nano
Create a file containing a brief description of your favorite Unix command and save it in your home directory as <command>.txt
![Page 18: Using Macs and Unix Nancy Griffeth January 6, 2014 Funding for this workshop was provided by the program “Computational Modeling and Analysis of Complex.](https://reader035.fdocuments.net/reader035/viewer/2022062716/56649dc75503460f94abcd5b/html5/thumbnails/18.jpg)
The Shell
Every Unix system runs a “shell” to interpret your commands Commands can be entered from a terminal
or The shell can be directed to read a file
containing commands (“. <filename>”) Mac OS X uses “bash” (Bourne-again
shell) by default
![Page 19: Using Macs and Unix Nancy Griffeth January 6, 2014 Funding for this workshop was provided by the program “Computational Modeling and Analysis of Complex.](https://reader035.fdocuments.net/reader035/viewer/2022062716/56649dc75503460f94abcd5b/html5/thumbnails/19.jpg)
The Shell
Types of commands: Built-in shell commands (shell
programming) Unix programs (e.g., ls, mv, etc.) Scripts (executable user files)
Shell variables set export echo
![Page 20: Using Macs and Unix Nancy Griffeth January 6, 2014 Funding for this workshop was provided by the program “Computational Modeling and Analysis of Complex.](https://reader035.fdocuments.net/reader035/viewer/2022062716/56649dc75503460f94abcd5b/html5/thumbnails/20.jpg)
The Shell
Start-up script: .bash_profile Sets important variables PATH: determines where the shell looks
for commands
![Page 21: Using Macs and Unix Nancy Griffeth January 6, 2014 Funding for this workshop was provided by the program “Computational Modeling and Analysis of Complex.](https://reader035.fdocuments.net/reader035/viewer/2022062716/56649dc75503460f94abcd5b/html5/thumbnails/21.jpg)
Exercises
Type “set” to see variables HOME PATH
![Page 22: Using Macs and Unix Nancy Griffeth January 6, 2014 Funding for this workshop was provided by the program “Computational Modeling and Analysis of Complex.](https://reader035.fdocuments.net/reader035/viewer/2022062716/56649dc75503460f94abcd5b/html5/thumbnails/22.jpg)
Keyboard Shortcuts
Auto-completion: Tab and double Tab Command history: Up and down arrows Cancel: ^C End of input: ^D
![Page 23: Using Macs and Unix Nancy Griffeth January 6, 2014 Funding for this workshop was provided by the program “Computational Modeling and Analysis of Complex.](https://reader035.fdocuments.net/reader035/viewer/2022062716/56649dc75503460f94abcd5b/html5/thumbnails/23.jpg)
Programs and executables
File permissions: Write: w Read: r Execute: x
![Page 24: Using Macs and Unix Nancy Griffeth January 6, 2014 Funding for this workshop was provided by the program “Computational Modeling and Analysis of Complex.](https://reader035.fdocuments.net/reader035/viewer/2022062716/56649dc75503460f94abcd5b/html5/thumbnails/24.jpg)
Final Exercises
Start RuleBender Run a bngl file Open the output using the “System
Editor” Open Excel and find the output files to
open. Navigate to the results directory using a
Unix terminal window