mirror of
https://github.com/xmengnet/the-art-of-command-line.git
synced 2024-12-24 10:46:29 +08:00
Rename OS X into the current macOS name
The name was changed in 2016; see https://en.wikipedia.org/wiki/MacOS#macOS
This commit is contained in:
parent
666c7fee18
commit
b4f7a83ce6
1 changed files with 10 additions and 10 deletions
20
README.md
Normal file → Executable file
20
README.md
Normal file → Executable file
|
@ -16,7 +16,7 @@
|
||||||
- [System debugging](#system-debugging)
|
- [System debugging](#system-debugging)
|
||||||
- [One-liners](#one-liners)
|
- [One-liners](#one-liners)
|
||||||
- [Obscure but useful](#obscure-but-useful)
|
- [Obscure but useful](#obscure-but-useful)
|
||||||
- [OS X only](#os-x-only)
|
- [macOS only](#os-x-only)
|
||||||
- [Windows only](#windows-only)
|
- [Windows only](#windows-only)
|
||||||
- [More resources](#more-resources)
|
- [More resources](#more-resources)
|
||||||
- [Disclaimer](#disclaimer)
|
- [Disclaimer](#disclaimer)
|
||||||
|
@ -39,7 +39,7 @@ but it has since moved to GitHub, where people more talented than the original a
|
||||||
Scope:
|
Scope:
|
||||||
|
|
||||||
- This guide is both for beginners and the experienced. The goals are *breadth* (everything important), *specificity* (give concrete examples of the most common case), and *brevity* (avoid things that aren't essential or digressions you can easily look up elsewhere). Every tip is essential in some situation or significantly saves time over alternatives.
|
- This guide is both for beginners and the experienced. The goals are *breadth* (everything important), *specificity* (give concrete examples of the most common case), and *brevity* (avoid things that aren't essential or digressions you can easily look up elsewhere). Every tip is essential in some situation or significantly saves time over alternatives.
|
||||||
- This is written for Linux, with the exception of the "[OS X only](#os-x-only)" and "[Windows only](#windows-only)" sections. Many of the other items apply or can be installed on other Unices or OS X (or even Cygwin).
|
- This is written for Linux, with the exception of the "[macOS only](#os-x-only)" and "[Windows only](#windows-only)" sections. Many of the other items apply or can be installed on other Unices or macOS (or even Cygwin).
|
||||||
- The focus is on interactive Bash, though many tips apply to other shells and to general Bash scripting.
|
- The focus is on interactive Bash, though many tips apply to other shells and to general Bash scripting.
|
||||||
- It includes both "standard" Unix commands as well as ones that require special package installs -- so long as they are important enough to merit inclusion.
|
- It includes both "standard" Unix commands as well as ones that require special package installs -- so long as they are important enough to merit inclusion.
|
||||||
|
|
||||||
|
@ -109,7 +109,7 @@ Notes:
|
||||||
|
|
||||||
- Use `nohup` or `disown` if you want a background process to keep running forever.
|
- Use `nohup` or `disown` if you want a background process to keep running forever.
|
||||||
|
|
||||||
- Check what processes are listening via `netstat -lntp` or `ss -plat` (for TCP; add `-u` for UDP) or `lsof -iTCP -sTCP:LISTEN -P -n` (which also works on OS X).
|
- Check what processes are listening via `netstat -lntp` or `ss -plat` (for TCP; add `-u` for UDP) or `lsof -iTCP -sTCP:LISTEN -P -n` (which also works on macOS).
|
||||||
|
|
||||||
- See also `lsof` and `fuser` for open sockets and files.
|
- See also `lsof` and `fuser` for open sockets and files.
|
||||||
|
|
||||||
|
@ -538,23 +538,23 @@ A few examples of piecing together commands:
|
||||||
- `fortune`, `ddate`, and `sl`: um, well, it depends on whether you consider steam locomotives and Zippy quotations "useful"
|
- `fortune`, `ddate`, and `sl`: um, well, it depends on whether you consider steam locomotives and Zippy quotations "useful"
|
||||||
|
|
||||||
|
|
||||||
## OS X only
|
## macOS only
|
||||||
|
|
||||||
These are items relevant *only* on OS X.
|
These are items relevant *only* on macOS.
|
||||||
|
|
||||||
- Package management with `brew` (Homebrew) and/or `port` (MacPorts). These can be used to install on OS X many of the above commands.
|
- 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 to a desktop app with `pbcopy` and paste input from one with `pbpaste`.
|
- Copy output of any command to a desktop app with `pbcopy` and paste input from one with `pbpaste`.
|
||||||
|
|
||||||
- To enable the Option key in OS X 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".
|
- 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".
|
||||||
|
|
||||||
- To open a file with a desktop app, use `open` or `open -a /Applications/Whatever.app`.
|
- 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`.
|
- Spotlight: Search files with `mdfind` and list metadata (such as photo EXIF info) with `mdls`.
|
||||||
|
|
||||||
- Be aware OS X 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 OS X release information, use `sw_vers`.
|
- To get macOS release information, use `sw_vers`.
|
||||||
|
|
||||||
## Windows only
|
## Windows only
|
||||||
|
|
||||||
|
@ -595,7 +595,7 @@ These items are relevant *only* on Windows.
|
||||||
## More resources
|
## More resources
|
||||||
|
|
||||||
- [awesome-shell](https://github.com/alebcay/awesome-shell): A curated list of shell tools and resources.
|
- [awesome-shell](https://github.com/alebcay/awesome-shell): A curated list of shell tools and resources.
|
||||||
- [awesome-osx-command-line](https://github.com/herrbischoff/awesome-osx-command-line): A more in-depth guide for the OS X command line.
|
- [awesome-osx-command-line](https://github.com/herrbischoff/awesome-osx-command-line): A more in-depth guide for the macOS command line.
|
||||||
- [Strict mode](http://redsymbol.net/articles/unofficial-bash-strict-mode/) for writing better shell scripts.
|
- [Strict mode](http://redsymbol.net/articles/unofficial-bash-strict-mode/) for writing better shell scripts.
|
||||||
- [shellcheck](https://github.com/koalaman/shellcheck): A shell script static analysis tool. Essentially, lint for bash/sh/zsh.
|
- [shellcheck](https://github.com/koalaman/shellcheck): A shell script static analysis tool. Essentially, lint for bash/sh/zsh.
|
||||||
- [Filenames and Pathnames in Shell](http://www.dwheeler.com/essays/filenames-in-shell.html): The sadly complex minutiae on how to handle filenames correctly in shell scripts.
|
- [Filenames and Pathnames in Shell](http://www.dwheeler.com/essays/filenames-in-shell.html): The sadly complex minutiae on how to handle filenames correctly in shell scripts.
|
||||||
|
|
Loading…
Reference in a new issue