Shell Essentials, Pt. 1 – apropos & man
It seems that I am always teaching someone something about the command line. It also appears to be happening more and more frequently. While the advice is most commonly about using bash, most of this...
View ArticleEnhancing git status with gs
Update: 2012-10-19 I never intended for this command to be useful by itself. It becomes useful when combined with other commands. It’s not about making git status searchable, but cleaning the output...
View ArticleFuzzy Finder in the Style of Bash
TL;DR I find fuzzy finders useful, they save me time and keystrokes. I wrote one for bash, the shell. I call it ff. ff () { # Author: Joshua Toyota (Unix Superhero) find . -type f | grep -i "$(echo...
View ArticleShell Tip: Run an aliased command, ignoring the alias (Solution #0)
How Bash Uses Aliases/Commands First, it will try to find an alias for the given name. If no alias is found, then it will use the first command in your $PATH by the given name. Scenario You set...
View ArticleShell Tip: Run an aliased command, ignoring the alias (Solution #1)
How Bash Uses Aliases/Commands First, it will try to find an alias for the given name. If no alias is found, then it will use the first command in your $PATH by the given name. Scenario You set...
View ArticleFaster Bash Fuzzy Finder; Ignores .gitignore Files; Combined with vim
I use grep a lot and at work we have a large code base, many different apps. Grep’s switches to exclude files from the search aren’t exactly quick to type. The files I normally want to exclude from my...
View ArticleGrep Tip: How To Include or Exclude dotfiles
Obligatory Introduction Over the years, cmd options have become engrained in my brain. For grep, they are: grep -Rin (recursive, case-insensitive, line numbers) grep -Ril (recursive, case-insensitive,...
View ArticleGit Tip: Remove a file from your entire git repo
tl;dr git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch path/to/file' --prune-empty --tag-name-filter cat -- --all Why Do This? Here are a few reasons why you might want to do...
View ArticleAdvanced Bash Keyboard Shortcuts
I strive for efficiency and precision when typing. I do most of my typing in vim and bash (or zsh). Bash has many functions that can be assigned to keyboard shortcuts with the bind command. Using...
View ArticleBash: Easy Way to Loop Through All Arguments
#!/bin/bashfor arg; do echo "someone passed in: $arg"done Of course, “arg” can be named anything: for x; do echo "var name is x: $x"done If this script were saved as argtest.sh, here is sample...
View Article
More Pages to Explore .....