Making It Yours

Short names, a startup file, a prompt in your colors, and the tools worth installing.

Updated

Shortcuts

  1. Aliases and Small Functions (Apprentice): An alias gives a long command a short name, such as ll for ls -lah, and a small function does the same for a job that needs the word you type after it, such as mkcd to make a folder and go into it.
  2. Startup Files: .bashrc, .zshrc and source (Apprentice): Bash reads ~/.bashrc every time a terminal opens, and a Mac's zsh reads ~/.zshrc, so aliases and functions you add there are always ready; keep a backup before you edit it, and use source to load your changes into the shell you're in.
  3. A Prompt in Your Colors (Journeyman): The prompt is the text in a variable, PS1, so you choose what it shows with codes such as \W for the folder and \A for the time, color it with \[\e[…m\] codes, show the Git branch with __git_ps1, and keep it in ~/.bashrc.

Installing

  1. Installing Tools: Homebrew and apt (Apprentice): A package manager is an app store you type to; on Ubuntu it's apt, which needs sudo to install, and on a Mac it's Homebrew's brew, which doesn't, and both search, install, update and remove tools by name.
  2. Your Dotfiles: A Setup You Can Carry (Journeyman): Dotfiles are the hidden settings files that make a shell yours; keep your own in a ~/dotfiles folder, link each one into place with ln -s, and keep the folder in Git if you use it, and a new computer is set up like your old one in a minute.

Exercise: Your Toolkit, Version 1

  1. Exercise: Your Toolkit, Version 1 (Apprentice): Build the first version of your own toolkit, a file of aliases, two small functions and a prompt in your colors, answer four questions about startup files and installing tools, and let a check script try every shortcut for real.