Command-line tool
- Evergreen
- u.
- c.
Useful built-in (macOS) command-line tools with examples.
curl
Client for URLs. Basic usage is for transfering data to and from servers using URLs.
Example
Request the contents of example.com.
$ curl example.com
<!doctype html><html lang="en"><head><title>Example Domain</title>...dig
Domain information groper. Basic usage is for querying DNS records for a domain.
Example
Query A records for the domain example.com.
$ dig example.com A
;; ANSWER SECTION:example.com. 133 IN A 104.20.23.154example.com. 133 IN A 172.66.147.243grep
Global regular expression print. Basic usage is for searching for text in a file using a regular expression, and print any lines that contain a match.
Example
Search, ignoring case (-i), for any line that start with “hello” in the file greeting.txt.
$ grep -i '^hello' greeting.txtHello, world!sed
Stream editor. Basic usage is for transforming a text stream, such as from a text file, and apply a command.
Example
Substitute (s) the word “world” for the word “you” in the text stream read from file greeting.txt.
$ sed 's/world/you/' greeting.txtHello, you!