1
0
mirror of https://github.com/jlevy/the-art-of-command-line.git synced 2024-12-04 10:24:46 +02:00

One more update to MacOS section.

#153
This commit is contained in:
Joshua Levy 2015-07-03 00:52:01 -07:00
parent 27eb7509a1
commit f4789f0aa4

View File

@ -442,13 +442,13 @@ 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.
- Copy output of any command with `pbcopy` and paste input with `pbpaste`.
- Copy output of any command to a desktop app with `pbcopy` and paste input from one with `pbpaste`.
- To open a file with a desktop app, use `open` or `open -a /Applications/Whatever.app`.
- 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).
- 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.
## More resources