Skip to content

Instantly share code, notes, and snippets.

@mogeko
Last active June 13, 2020 20:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mogeko/e7e74819329fe917cfd955faa7bab98d to your computer and use it in GitHub Desktop.
Save mogeko/e7e74819329fe917cfd955faa7bab98d to your computer and use it in GitHub Desktop.

Install

Download file GNU_Brewfile, then run:

brew bundle --file GNU_Brewfile

Configuration

All commands have been installed with the prefix g.

If you need to use these commands with their normal names, you can add some gnubin directory to your PATH from your ~/.bashrc or ~/.bash_profile like:

export PATH="/usr/local/opt/binutils/bin:$PATH"
export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"
export PATH="/usr/local/opt/ed/libexec/gnubin:$PATH"
export PATH="/usr/local/opt/findutils/libexec/gnubin:$PATH"
export PATH="/usr/local/opt/gawk/libexec/gnubin:$PATH"
export PATH="/usr/local/opt/gnu-indent/libexec/gnubin:$PATH"
export PATH="/usr/local/opt/gnu-sed/libexec/gnubin:$PATH"
export PATH="/usr/local/opt/gnu-tar/libexec/gnubin:$PATH"
export PATH="/usr/local/opt/gnu-which/libexec/gnubin:$PATH"
export PATH="/usr/local/opt/grep/libexec/gnubin:$PATH"

Additionally, you can access their man pages with normal names if you add the gnuman directory to your MANPATH from your ~/.bashrc or ~/.bash_profile as well:

export MANPATH="/usr/local/opt/binutils/share/gnuman:$MANPATH"
export MANPATH="/usr/local/opt/coreutils/libexec/gnuman:$MANPATH"
export MANPATH="/usr/local/opt/ed/libexec/gnuman:$MANPATH"
export MANPATH="/usr/local/opt/findutils/libexec/gnuman:$MANPATH"
export MANPATH="/usr/local/opt/gawk/libexec/gnuman:$MANPATH"
export MANPATH="/usr/local/opt/gnu-indent/libexec/gnuman:$MANPATH"
export MANPATH="/usr/local/opt/gnu-sed/libexec/gnuman:$MANPATH"
export MANPATH="/usr/local/opt/gnu-tar/libexec/gnuman:$MANPATH"
export MANPATH="/usr/local/opt/gnu-which/libexec/gnuman:$MANPATH"
export MANPATH="/usr/local/opt/grep/libexec/gnuman:$MANPATH"

gdb

gdb requires special privileges to access Mach ports.

You will need to codesign the binary. For instructions, see here.

On 10.12 (Sierra) or later with SIP, you need to run this:

echo "set startup-with-shell off" >> ~/.gdbinit
tap "homebrew/bundle"
tap "homebrew/core"
# Macro processing language
brew "m4"
# Bourne-Again SHell, a UNIX command interpreter
brew "bash"
# GNU binary tools for native development
brew "binutils"
# GNU File, Shell, and Text utilities
brew "coreutils"
# File comparison utilities
brew "diffutils"
# Classic UNIX line editor
brew "ed"
# GNU Emacs text editor
brew "emacs"
# Collection of GNU find, xargs, and locate
brew "findutils"
# GNU awk utility
brew "gawk"
# GNU debugger
brew "gdb" # gdb requires further actions to make it work. See `brew info gdb`.
# C code prettifier
brew "gnu-indent"
# GNU implementation of the famous stream editor
brew "gnu-sed"
# GNU version of the tar archiving utility
brew "gnu-tar"
# GNU implementation of which utility
brew "gnu-which"
# GNU Transport Layer Security (TLS) Library
brew "gnutls"
# Apply a diff file to an original
brew "gpatch"
# GNU grep, egrep and fgrep
brew "grep"
# Popular GNU data compression program
brew "gzip"
# Utility for directing compilation
brew "make"
# Free (GNU) replacement for the Pico text editor
brew "nano"
# Terminal multiplexer with VT100/ANSI terminal emulation
brew "screen"
# Executes a program periodically, showing output fullscreen
brew "watch"
# Display word differences between text files
brew "wdiff"
# Internet file retriever
brew "wget"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment