3 ms·
Very cool finding! Made me want to explore what other tools my mac has pre-installed in /usr/bin
by Alifatisk 4y ago
Very cool finding! Made me want to explore what other tools my mac has pre-installed in /usr/bin
- jfarmer 4y agoOne nice thing about macOS is that many of the system GUI tools are graphical wrappers around a command-line tool that does the real work. Most of them live in /usr/sbin I keep a list for my students. Here are some: diskutil mdfind mdutil plutil networksetup softwareupdate screencapture pmset hdiutil pkgutil caffeinate osascript defaults launchctl For example, mdfind lets you use Spotlight search on the command line. diskutil powers "Disk Utility.app". pkgutil lets you install .pkg files and also get information about programs installed that way. screencapture lets you take screenshots from the command line (you can specify which windows, etc.) Anyhow, there's a bunch. There are also random useful executables not in $PATH. This program powers your WiFi menu: /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport Try "airport -I" A silly one-liners to print out your overall WiFi strength: airport -I | grep -E 'agrCtlRSSI|agrCtlNoise' | awk '{print $2}' | sed -e 'N;s/\n/ - /' | bc Put that in a script called "wifi-strength" and walk around your house with a laptop while running the following: watch -n1 "wifi-strength | say"
- Alifatisk 4y agoWhat a goldmine, thanks!
- jijojv 4y agoVery Nice! One caveat is that say won't speak the "minus" if your SNR became negative. echo '-30' | say echo '\-30' | say
- jfarmer 3y agoThanks!
- comex 4y agoNitpick: In general, the graphical tools don’t literally invoke the command-line tools. Rather, both the graphical tool and the command-line tool use the same C or Objective-C API (usually private and undocumented) provided by some system framework. But the command-line tools do tend to be more direct reflections of the underlying API, and more flexible.
- jfarmer 3y agoOops. Yeah, I knew some of them did and then at some point I just started tossing more programs in the list as I ran across them.
- ytch 4y agoPersonally I found it interesting that: * TFTP server [1] * PF Firewall [2] * pbcopy & pbpaste [3] are built-in in MacOS. Here[4] is list of MacOS command line man pages, some interesting tools can be found there. [1] https://rick.cogley.info/post/run-a-tftp-server-on-mac-osx/ https://rick.cogley.info/post/run-a-tftp-server-on-mac-osx/ [2] https://iyanmv.medium.com/setting-up-correctly-packet-filter-pf-firewall-on-any-macos-from-sierra-to-big-sur-47e70e062a0e https://iyanmv.medium.com/setting-up-correctly-packet-filter... [3] https://osxdaily.com/2007/03/05/manipulating-the-clipboard-from-the-command-line/ https://osxdaily.com/2007/03/05/manipulating-the-clipboard-f... [4] https://ss64.com/osx/ https://ss64.com/osx/
- anony23 4y agoPbcopy/pbpaste are huge productivity boosters for me
- nier 4y agoPb stands for pasteboard and not for lead. :D http://www.nextcomputers.org/NeXTfiles/Docs/NeXTStep/3.3/nd/GeneralRef/02_ApplicationKit/Classes/Pasteboard.htmld/index.html http://www.nextcomputers.org/NeXTfiles/Docs/NeXTStep/3.3/nd/...
- just_steve_h 4y agoI have a shell alias so I can just type pb to do pbpaste|pbcopy - easiest way I’ve found to strip formatting and get plain text.
- wtallis 4y agoIt's a little awkward, but Cmd-Opt-Shift-V is "Paste and Match Style" aka "paste as plain text".
- blairbeckwith 4y agoPro-tip (at least for me): control (^) doesn't change this, so you can just hold all the modifier keys rather than trying to remember which 3 let you paste as plain text.