From 7575f23c68e9f7a733ccff6e076c6c3b8072b344 Mon Sep 17 00:00:00 2001 From: John Chang Date: Fri, 24 May 2019 09:34:51 +0100 Subject: [PATCH] Add Mac-specific tricks for Terminal --- README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 77d2444..27e8a96 100755 --- a/README.md +++ b/README.md @@ -550,15 +550,19 @@ These are items relevant *only* on macOS. - Package management with `brew` (Homebrew) and/or `port` (MacPorts). These can be used to install on macOS many of the above commands. +- Drag an item from Finder to Terminal to paste its path. + - Copy output of any command to a desktop app with `pbcopy` and paste input from one with `pbpaste`. -- To enable the Option key in macOS Terminal as an alt key (such as used in the commands above like **alt-b**, **alt-f**, etc.), open Preferences -> Profiles -> Keyboard and select "Use Option as Meta key". +- In Terminal, Option-click to move the cursor e.g. when editing text. To enable the Option key as an alt key instead (such as used in the commands above like **alt-b**, **alt-f**, etc.), open Preferences -> Profiles -> Keyboard and select "Use Option as Meta key". - To open a file with a desktop app, use `open` or `open -a /Applications/Whatever.app`. +- `xed` opens a file for editing in Xcode. + - Spotlight: Search files with `mdfind` and list metadata (such as photo EXIF info) with `mdls`. -- Be aware macOS is based on BSD Unix, and many commands (for example `ps`, `ls`, `tail`, `awk`, `sed`) have many subtle variations from Linux, which is largely influenced by System V-style Unix and GNU tools. You can often tell the difference by noting a man page has the heading "BSD General Commands Manual." In some cases GNU versions can be installed, too (such as `gawk` and `gsed` for GNU awk and sed). If writing cross-platform Bash scripts, avoid such commands (for example, consider Python or `perl`) or test carefully. +- Be aware macOS is based on BSD Unix, and many commands (for example `ps`, `ls`, `tail`, `awk`, `sed`) have many subtle variations from Linux, which is largely influenced by System V-style Unix and GNU tools. You can often tell the difference by noting a man page has the heading "BSD General Commands Manual." In some cases GNU versions can be installed, too (such as `gawk` and `gsed` for GNU awk and sed). If writing cross-platform Bash scripts, avoid such commands (for example, consider Python or Perl) or test carefully. - To get macOS release information, use `sw_vers`.