M A C S T E R M I N A L P R E S E N T E D O N M A R C H 8 , 2 - - PowerPoint PPT Presentation

m a c s t e r m i n a l
SMART_READER_LITE
LIVE PREVIEW

M A C S T E R M I N A L P R E S E N T E D O N M A R C H 8 , 2 - - PowerPoint PPT Presentation

M A C S T E R M I N A L P R E S E N T E D O N M A R C H 8 , 2 0 1 6 B Y B U RT S T E P H E N S , O M U G M E M B E R Note: You will not be able to run Terminal from this PDF. You are encouraged to try Terminal on your computer.


slide-1
SLIDE 1

M A C ’ S T E R M I N A L

P R E S E N T E D O N M A R C H 8 , 2 0 1 6 B Y B U RT S T E P H E N S , O M U G M E M B E R

Music: From the Terminal Movie, John Williams Conducting

Note: You will not be able to run Terminal from this PDF. You are encouraged to try Terminal on your computer.

slide-2
SLIDE 2

G E T T I N G U N D E R T H E H O O D

slide-3
SLIDE 3

A B O U T T E R M I N A L

  • Included with All Versions of Macs’ OS X
  • Works under the hood (by providing an Interface to

control the UNIX Operating System

  • Uses a Command Line rather than a Graphic

Interface

  • “Terminal” is a terminal emulator - the devices

people used in the days of mainframe computers

http://www.macworld.co.uk/feature/mac-software/get-more-out-of-os-x-terminal-3608274/

slide-4
SLIDE 4

S O M E T H I N G S Y O U C A N D O

  • Show Hidden Files (defaults write com.apple.finder AppleShowAllFiles TRUE)
  • Disable Window Animations (defaults write NSGlobalDomain

NSAutomaticWindowAnimationsEnabled -bool false)

  • Change Screenshot Formats (defaults write com.apple.screencapture type file-extension)
  • Show File Path Info (defaults write com.apple.finder _FXShowPosixPathInTitle -bool YES)
  • Erase Free Hard Drive Space Securely

(diskutil secureErase freespace 3/Volumes/hard-drive-name) OR ( sudo rm -rf /)

  • Enable AirDrop Over Ethernet (defaults write com.apple.NetworkBrowser BrowseAllInterfaces -

bool true)

slide-5
SLIDE 5

How to open the command line

  • On OS X, open your Applications folder
  • Then open the Utilities folder
  • Then Open the Terminal application.
  • You may want to add this to your dock.
  • OR you can launch terminal by using Spotlight search in OS X, searching for “terminal”.
slide-6
SLIDE 6

S O M E B A S I C T E R M I N A L C O M M A N D S

  • cd - change directory
  • mkdir - make directory
  • pwd - path of current directory
  • touch - create multiple files
  • cp - copy
  • ls - list
  • mv - move (replace)
  • rm - remove or delete
  • open - opens a file
  • clear - clear the window

http://www.macworld.co.uk/feature/mac-software/get-more-out-of-os-x-terminal-3608274/

slide-7
SLIDE 7

F O R M AT O F A C O M M A N D L I N E

  • Command
  • Argument
  • Flags
slide-8
SLIDE 8

I N S TA N T LY G E N E R AT E A C A L E N D A R

C O M M A N D : C A L M O N T H Y E A R ( C A L 3 2 0 1 6 )

slide-9
SLIDE 9

N AV I G AT I N G T O F O L D E R S

E X A M P L E : C D / A P P L I C AT I O N S / U T I L I T I E S T H E N L S

slide-10
SLIDE 10

L I S T C O N T E N T S O F D I R E C T O RY

L I S T - L S ; V I E W I N A L I S T F O R M A T - L S - L

slide-11
SLIDE 11

E N A B L E A I R D R O P O N O L D E R M A C S

AirDrop sends files between Macs quickly and easily. Trouble is, it’s only

  • n WiFi and on more recent Macs. If your Mac doesn’t currently support

AirDrop, you can enter the following command to use it, as well as to use it over ethernet:

$ defaults write com.apple.NetworkBrowser BrowseAllInterfaces -bool TRUE

You’ll need to restart the Finder, the quickest way is to use the killall command which will restart it:

$ killall Finder

To revert the changes, enter:

$ defaults write com.apple.NetworkBrowser BrowseAllInterfaces -bool

slide-12
SLIDE 12

R E B U I L D S P O T L I G H T

Spotlight can occasionally not work as well as we’d

  • like. Sometimes, we just need to tell Spotlight to

create a new index so it can find files as fast and efficiently as possible. To do this: $ sudo mdutil -E /Volumes/DriveName The above command will delete Spotlight’s index, forcing it to start a new one. SUDO requires a password which is your computer administrative password. It allow the user to execute a command as superuser or to another

  • computer. BUT BE CAREFUL.
slide-13
SLIDE 13

M A K E Y O U R M A C TA L K

Example of Talking with a Selected Voice: say -v Karen “Hello Jim” Example of Audio Text File Being Saved: say -v Alex -r 175 -o /Users/burtstephens/Music/Young_output.aiff -f / Users/burtstephens/Desktop/young.txt v = voice, -r =reading speed, -o = output type and location,

  • f = specific text file
slide-14
SLIDE 14

D O W N L O A D F R O M U N S TA B L E S E R V E R

Sometimes you are downloading a big file, but it keeps

failing, and you always have to hit RESUME. Your problems are over, with this code, if the download stops suddenly, it will automatically restart. This code have a 15kbps speed limit, delete –limit-rate 15k to remove the speed limit. while ! curl -C - -O --limit-rate 15k file-address- goes-here; do sleep 10; done

slide-15
SLIDE 15

A D D R E S S B O O K D E B U G M E N U

If you have some trouble with Address Book it may be useful to

  • pen up the debug menu as well as this use some of the hidden
  • features. Make sure address book is closed first before applying

the code. If you want to revert it remove YES in the string. defaults write com.apple.addressbook ABShowDebugMenu -bool YES

slide-16
SLIDE 16

E N A B L E T I M E M A C H I N E O N U N S U P P O RT E D D R I V E S

Enable Time Machine to work on unsupported drives such as a

  • NAS. Use with caution as it is unsupported.

defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1

slide-17
SLIDE 17

S E T S C R E E N S AV E R A S WA L L PA P E R

This command sets the currently selected screen saver as the desktop

  • background. Use command + c or . to stop while in Terminal.

Alternatively you can use wallsaver. /System/Library/Frameworks/ScreenSaver.framework/ Resources/ScreenSaverEngine.app/Contents/MacOS/ ScreenSaverEngine -background

slide-18
SLIDE 18

E J E C T A S T U C K O R D V D

For a Single Optical Drive use the command:

drutil eject

If you have both an internal and external optical drive: Use either

drutil eject internal

  • r

drutil eject external

slide-19
SLIDE 19

Some Terminal Commands to Speed up your Mac in OS X El Capitan

1.. Disable animations when opening and closing windows.

  • 2. Disable animations when opening a Quick Look window.
  • 3. Accelerated playback when adjusting the window size
  • 4. Disable animation when opening the Info window in OS X Finder
  • 5. Disable animations when you open an application from the Dock.
  • 6. Make all animations faster that are used by Mission Control.
  • 7. Disable the delay when you hide the Dock
  • 8. Disable the animation when you sending and replying an e-mail
  • 9. Disable the standard delay in rendering a Web page.
  • 10. The keyboard reacts faster to keystrokes

http://www.defaults-write.com/10-terminal-commands-to-speed-up-your-mac-in-os-x-el-capitan/

slide-20
SLIDE 20

D E V E L O P A L I B R A RY O F C O M M A N D S https://github.com/herrbischoff/awesome-osx-command-line#shells

  • Appearance
  • Transparency
  • Wallpaper
  • Applications
  • App Store
  • Apple Remote Desktop
  • Contacts
  • iTunes
  • Mail
  • Safari
  • Sketch
  • Skim
  • TextEdit
  • Backup
  • Time Machine

… Contacts Debug Mode # Enable defaults write com.apple.addressbook ABShowDebugMenu -bool true # Disable (Default) defaults write com.apple.addressbook ABShowDebugMenu -bool false

slide-21
SLIDE 21

VA C U U M M A I L I N D E X

For a large email database that hasn't been optimized for a while, this can provide significant improvements in responsiveness and speed.

slide-22
SLIDE 22

TA K I N G T H E N E X T S T E P S

slide-23
SLIDE 23

P R O G R A M M I N G W I T H P Y T H O N

  • Python is pre-installed with latest versions
  • f OS X
  • (El Capitan comes with Python 2.7)
  • More serious users with want to download

Xcode and Homebrew

Python is a clear and powerful object-oriented programming language, comparable to Perl, Ruby, Scheme, or Java.

slide-24
SLIDE 24

S I M P L E E X A M P L E W I T H P Y T H O N : L I S T I N G N A M E S O F F R I E N D S

slide-25
SLIDE 25

A N O T H E R P Y T H O N E X A M P L E : I F, I F - E L S E , A N D E L S E

slide-26
SLIDE 26

H O M E B R E W

  • Free and open-source software that simplifies the

installation of software on Apple's OS X operating system.

  • Written in Ruby programming language which comes

installed with oS X

Homebrew Cask extends Homebrew with support for quickly installing Mac applications like Google Chrome, VLC, and

  • more. No more dragging and dropping applications!
slide-27
SLIDE 27

X C O D E

.

The newest version of Xcode -7 includes everything you need to create apps for iPhone, iPad, Mac, and Apple Watch. The Swift programming language (Version 2) has been updated and is now faster than ever, with great features that make your code even easier to read and write. And with the new playgrounds you can experiment with new APIs or author gorgeous interactive documentation using embedded resources, additional source code, and rich text comments. Xcode’s user interface testing feature can even record your app in action and generate tests for you.

To Install X Code: https://itunes.apple.com/us/app/xcode/id497799835?mt=12

slide-28
SLIDE 28

O T H E R U S E F U L A P P L I C AT I O N S

Automator or Hazel

For OS X that implements point-and-click (or drag and drop) creation

  • f workflows for automating repetitive tasks into batches for quicker

alteration, saving time and effort over manually changing each file separately. https://www.noodlesoft.com/hazel.php

slide-29
SLIDE 29

Y O U C O U L D W I N AT T O N I G H T ’ S R A F F L E

slide-30
SLIDE 30

Figure out what’s preventing a disk from unmounting or ejecting Tell which applications are currently assessing the Internet Rename files in bulk (older OS Xs) Chase File Permissions Automate command-line activities with scripts

With Joe Kissell’s Book you will be able to -

slide-31
SLIDE 31

Terminal Emulators for Mac and iOS Devices

OS X

  • Terminal - default OS X terminal
  • iTerm2 - open-source terminal specifically for OS X
  • xterm - default terminal when the X Window System started
  • MacWise
  • SecureCRT
  • SyncTERM - includes serial line terminal
  • Terminator
  • ZOC
  • ZTerm - serial line terminal

Mac OS

  • MacTerminal
  • Red Ryder
  • ZTerm
slide-32
SLIDE 32

B A S I C T E R M I N A L U S A G E

https://www.youtube.com/watch?v=jDINUSK7rXE

slide-33
SLIDE 33

https://www.youtube.com/watch?v=MirG-vJOg04

slide-34
SLIDE 34

Useful Python Modules

See http://ubuntuforums.org/showthread.php?t=522688

slide-35
SLIDE 35

say -v Alex -r 175 -o /Users/ say -v Alex -r 150 -o /Users/burtstephens/ Music/Goodbye_output.aiff -f /Users/ burtstephens/Desktop/Bye.txt BASH SUDO Example of use of “say” command with

  • utput to stored

audio file, followed by short quiz using keynote branching features

slide-36
SLIDE 36

Question 1

What is the meaning to the computer term -“Bash”?

  • A. a boastful command
  • B. a UNIX shell
  • C. a program that politicians use
  • D. legacy programs developed by Steve Jobs

Next Question

slide-37
SLIDE 37

You are Wrong

  • In ordinary language BASH means to strike

violently or to attack physically or verbally, but this is not a computer term

Return

slide-38
SLIDE 38

You Got it

Literally BASH refers to Bourne Again Shell -a command line processor for Unix from the Free Software Foundation. It is the de facto command processor in Linux and Mac. Return

slide-39
SLIDE 39

You’re Wrong

  • These days politicians are said to slash and bash

their opponents, but this is not a computer term.

Return

slide-40
SLIDE 40

NO! NO! NO!

According to Steve Wozniak "Steve Jobs didn't ever code. He wasn't an engineer and he didn't do any original design, but he was technical enough to alter and change and add to other designs." Return

slide-41
SLIDE 41

Question 2

What do you need to do to use SUDO as part of a terminal command line?

  • A. complete an easy SUDOKU puzzle
  • B. use a Microsoft Windows 10 Operating System
  • C. use your Administrator Password
  • D. review all the Terminal

Commands

That’s All

slide-42
SLIDE 42

Nope!

Sudoku is one of the most popular puzzle games of all time. The goal of Sudoku is to fill a 9×9 grid with numbers so that each row, column and 3×3 section contain all of the digits between 1 and 9 But Sudoku has nothing to do with the SUDO command.

Return

slide-43
SLIDE 43

NO!

Although there are people who use the Windows 10 Operating System, they usually shun people who use Macs. It is suggested that Mac people patiently reach out to those using Windows and help them see the light.

Return

slide-44
SLIDE 44

You’ve Got it!

Although there are other devious ways to find the Password for SUDO, the straight-forward way is to simply enter the computer administrative password.

Return

slide-45
SLIDE 45

No Way!

This would be a chore and it wouldn’t help you to access the SUDO command.

Return

slide-46
SLIDE 46

This really is