Live data from Hacker News

macOS command-line tools you might not know about

saurabhs.org

351–360 of 454 posts

Re: macOS command-line tools you might not know about

#352

Interesting so many useful commands, but they didn't have time to fix basics like scroll wheel, so you have to install 3rd party apps to set it independently from the touch pad and then it still manages to swap it around at random times. Am I the only one who finds macOS so annoying? I mean the apps for scroll wheel, alt-tab and what not...

The issues I have are touch-dragging with the touchpad, and no window docking. Docking I fixed by buying 'Magnet', touch dragging is still annoying. They have a setting that is supposed to enable 'double tap drag' like windows, but when you let go, it keeps dragging for some random amount of time, making it unusable.

Settings > Accessibility > Pointer Control > Trackpad Options...

Three-Finger Drag works really well and is surprisingly easy to get used to doing.

Re: macOS command-line tools you might not know about

#353
post #295
post #3

Neat, I was not aware of `networkQuality`. A good replacement for opening up Speedtest or whatnot when you just want to figure out if the network is slow or something else is up.

I can't find any (official) documentation on how it measures the speed. Against which target? Edit: Found https://www.macinstruct.com/tutorials/how-to-check-your-macs... which says: "The networkquality tool uses Apple’s CDN ( https://mensura.cdn-apple.com/api/v1/gm/config ) as a target" The contents of this file (for me): { "version": 1, "test_endpoint": "sesto4-edge-bx-021.aaplimg.com", "urls": { "small_https_downlo…

I find solace in the fact that even at large companies, there's still enough whimsy to name your upload endpoint slurp.

Re: macOS command-line tools you might not know about

#354
I 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 files, command history, etc.

4. tldr: Community-driven man pages with practical examples.

5. ripgrep (rg): Extremely fast text search tool, recursively searches directories for a regex pattern.

6. tmux: Terminal multiplexer to run multiple terminal sessions within a single window.

7. autoenv: Automatically source environment variables based on the current directory.

8. hub: Extends git with extra features and commands for GitHub.

9. ncdu: Disk usage analyzer with an ncurses interface.

10. jq: Lightweight command-line JSON processor.

11. sshfs: Mount a remote filesystem using SFTP.

12. watch: Execute a program periodically, showing output fullscreen.

13. fd: Simpler and faster alternative to `find`.

14. z: Jump around directories based on frequent use.

15. lazygit: Simple terminal UI for git commands.

Most of them I already knew, but z seems like an interesting tool. The docs are here https://github.com/rupa/z>:

       z foo         cd to most frecent dir matching foo

       z foo bar     cd to most frecent dir matching foo, then bar

       z -r foo      cd to highest ranked dir matching foo

       z -t foo      cd to most recently accessed dir matching foo

       z -l foo      list all dirs matching foo (by frecency)
Might start using it, if I'm not too stuck in my habits.

Re: macOS command-line tools you might not know about

#356
post #3

Neat, I was not aware of `networkQuality`. A good replacement for opening up Speedtest or whatnot when you just want to figure out if the network is slow or something else is up.

There is also a CLI client for speedtest.net[1] and fast.com[2]! Not included with MacOS, of course, but nice to have around.

[1] https://www.speedtest.net/apps/cli

[2] https://github.com/sindresorhus/fast-cli

Re: macOS command-line tools you might not know about

#357

`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

#359

`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.

Sublime Text and Sublime Merge actually ship with these CLI utilities by default, which have some additional features:

    $ fd 's(merge|ubl)$' /Applications/Sublime*                                          
    /Applications/Sublime Merge.app/Contents/SharedSupport/bin/smerge
    /Applications/Sublime Text.app/Contents/SharedSupport/bin/subl

Re: macOS command-line tools you might not know about

#360
post #346

I find it extremely upsetting that `networkQuality` is the only command that is not entirely lowercase. How did this get through PR??

APFS isn't case-sensitive, so you can type networkquality if it makes you happy. :-)

Wow, truly a pro tip, thank you!
Post reply on HN