Browsed by
Category: CLI

Command Line or Terminal

[Unsolved] (Homebrew) Emacs.app doesn’t appear in Spotlight

[Unsolved] (Homebrew) Emacs.app doesn’t appear in Spotlight

After using brew linkapps emacs Emacs still didn’t show in Spotlight for me. I googled and found this issue https://github.com/Homebrew/legacy-homebrew/issues/4635 TL;DR nothing got fixed on the homebrew side. Caskroom puts stuff into /opt where as Homebrew puts stuff into /usr/local which is why that it works fine. According to this comment using an OS X “Alias” will fix it. But that didn’t work for me on El Capitan. Apparently moving Emacs.app may have problems due to Homebrew passing –disable-ns-self-contained Which…

Read More Read More

Order of arguments/options in Homebrew

Order of arguments/options in Homebrew

I came across this comment on Super User and wanted to see which was the correct order of arguments for brew Is it brew install –option formula or brew install forumla –option? https://trac.ffmpeg.org/wiki/CompilationGuide/MacOSX has the options listed as brew install ffmpeg –with-fdk-aac –with-ffplay –with-freetype –with-libass –with-libquvi –with-libvorbis –with-libvpx –with-opus –with-x265 and was last modified on the 1st of March 2016. However brew(1) from man shows: NAME brew – The missing package manager for OS X SYNOPSIS brew –version brew command…

Read More Read More

Search for a command in Homebrew

Search for a command in Homebrew

Two ways: brew search forumla Which is in built however won’t work if you are looking for if it’s not the name of the formula. This is my script called brew-search #!/usr/bin/env bash curl –silent –compressed https://raw.githubusercontent.com/Homebrew/homebrew-command-not-found/master/executables.txt | grep -P “^$1:|[: ]$1( |$)” | grep -Po ‘^.+(?=:)’ Which can be called by brew-search command My script works for xxd. $ brew search xxd $ brew-search xxd vim

Readline / Command Line Shortcuts

Readline / Command Line Shortcuts

CTRL-A Goto start of line CTRL-E Goto end of line CTRL-W Cut word to left ALT-D Cut word to right ALT-B Move one word to left ALT-F Move one word to right Turns out you can also use alt + arrow keys: ALT-LEFT Move one word to left ALT-RIGHT Move one word to right By default ALT does not work in iTerm or Terminal on OS X. However this is a fix.

Today I Learnt: Symlinks are Relative

Today I Learnt: Symlinks are Relative

If the current working directory is /Users/admin I thought the two commands should work the same. ln -s borg-env/bin/borg /usr/local/bin/borg ln -s /Users/admin/borg-env/bin/borg /usr/local/bin/borg However the first one gives me “-bash: borg: command not found” when I run borg. It only hit me when I looked closer at the output of ls -la /usr/local/bin/ lrwxr-xr-x 1 admin admin 33 28 Feb 20:56 bashbug -> ../Cellar/bash/4.3.42/bin/bashbug lrwxr-xr-x 1 admin admin 17 19 Apr 18:14 borg -> borg-env/bin/borg Where I saw ../,…

Read More Read More

How to use rsync

How to use rsync

rsync <options> /from/folder/path user@host:/path/to Note about paths: /from/folder/path means send the whole folder, where as /from/folder/path/ means send just the contents of the folder. If you want to send ~/sync so it ends up into ~/sync on the other computer then use: rsync -a ~/sync user@host: The syntax is like that of scp Common Options: -a does recursive (so no need for r) -P Shows progress and allows you to resume interrupted transfers. –checksum verify checksum (currently MD5) when the…

Read More Read More