A lot of macOS behavior can be toggled by modifying the system component defaults. For example, turn off autohiding of the Dock from commandline: defaults write com.apple.dock "autohide" -bool "false" && killall Dock Include the date in screenshots you take: defaults write com.apple.screencapture "include-date" -bool "true" Here is handy website which documents many of the defaults and their purpose: https://macos-de…
https://github.com/zcutlip/prefsniff can be handy for figuring this stuff out, you start it up, change a setting, and it reports the plist differences to you
macOS command-line tools you might not know about
361–370 of 454 posts
Re: macOS command-line tools you might not know about
#362Earlier quoted context omitted.
Agreed. Some of the flags are missing as well. Not sure it's updated often, but still not a bad starting point. If only Apple would publish something directly. They do a pretty good job with the Apple Platform Deployment guide ( https://support.apple.com/guide/deployment ). And the Security guide ( https://support.apple.com/guide/security ).
I maintain updated lists here: https://manp.gs/mac/1/ https://manp.gs/mac/8/
Re: macOS command-line tools you might not know about
#363`open` is one I use all the time. I love that simple command. alias tab='open . -a iterm' alias phpstorm='open -a "PhpStorm"' alias smerge='open -a "Sublime Merge"' etc. I use those more than I do the Open/Recents dialogs in the respective apps.
> alias tab='open . -a iterm' But if you just open a new tab, you'll be in the same $CWD in the new tab? Am I missing some trick here?
Re: macOS command-line tools you might not know about
#364Earlier quoted context omitted.
Don't forget to pipe head into 'cat -v'... that text file could contain _anything_!
I really recommend folks use "less" over cat, especially keyboard oriented folks. Different terminal emulators don't always have the scroll behavior I want, not do they always allow me to search the file I'm looking at. "less" does all those things, in nearly every environment no matter the terminal emulator, and has other wonderful options to boot (chop long lines so they don't wrap can be nice for logs, line number…
Re: macOS command-line tools you might not know about
#365`pbcopy` and `pbpaste` are one of my most-loved in the list. Dealing with some minified json, switching to iTerm, doing `pbpaste | json_pp | pbcopy` and having a clean output is _so_ nice.
I have a script always running that polls for youtube URLs using pbpaste and runs yt-dl then just highlight any youtube link and COPY later when I have time, I can use quicklook to browse directory of youtube videos.
Re: macOS command-line tools you might not know about
#366I just tried the following: I copied all of my ~/.bash_history into GPT and asked it for some commands that would save me time. It didn't quite work to identify "bad patterns" as I had hoped, but it did suggest the following: 1. bat : A `cat` clone with syntax highlighting and Git integration. 2. htop : Interactive process viewer, a better alternative to `top`. 3. fzf : Command-line fuzzy finder to quickly search fil…
I wouldn't do that. I treat ChatGPT as public.
But it's a good list nevertheless
Re: macOS command-line tools you might not know about
#367`pbcopy` and `pbpaste` are one of my most-loved in the list. Dealing with some minified json, switching to iTerm, doing `pbpaste | json_pp | pbcopy` and having a clean output is _so_ nice.
I have a script always running that polls for youtube URLs using pbpaste and runs yt-dl then just highlight any youtube link and COPY later when I have time, I can use quicklook to browse directory of youtube videos.
I download and save it as 'ytdl' for convenience, but I use it all the time on twitter too.
Re: macOS command-line tools you might not know about
#368Is there a place Apple documents these things? Do people find these things with something like “ls /usr/bin” and wondering “what is this?” or does Apple have an administrator’s guide somewhere? Or has someone written a good book with this stuff?
alias list-functions='functions -x4'
alias list-function-names='functions +'
alias list-aliases='alias'
alias list-alias-names='alias +'
alias list-commands='print -raC2 ${(kv)commands} | sort'
alias list-command-names='print -roC1 ${(k)commands}'
alias list-builtins='print -raC2 ${(kv)builtins} | sort'
alias list-builtin-names='print -roC1 ${(k)builtins}'
alias list-everything='whence -cm "[^_]*"'
alias list-everything-names='whence -wm "[^_]*"'
Edit: another commenter posted what looks to be comprehensive docs/lists here: https://news.ycombinator.com/item?id=36492487Re: macOS command-line tools you might not know about
#369Re: macOS command-line tools you might not know about
#370Earlier quoted context omitted.
In what way do you see those alternatives as superior?
If the command is meant to stream through something really fast by using a large buffer size, then prepending a cat(1) will limit the incoming buffer size to ~4k.
Maybe use dd with one of its blocksize options, then?
Not at a terminal, can't check.