Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Commands

  • Remove specific Dir and it’s sub-dir

    find . -type d -name <NAME-OF-DIR> -exec rm -rf {} \;
    
    find . -type d -name build -exec rm -rf {} \;
    find . -type d -name .gradle -exec rm -rf {} \;
    
  • Change All File Extensions in a Directory via the Command Line

    for file in *.java; do mv "$file" "${file%.java}.kt"; done
    
  • Squash all commits and reset

     git reset $(git commit-tree HEAD^{tree} -m "Initial Commit")
    
  • Upgrade all the casks installed via Homebrew Cask

    • To upgrade ALL apps that are outdated:

      brew outdated --cask --greedy --verbose | grep -v '(latest)' | awk '{print $1}' | xargs brew reinstall --cask
      
    • Reinstall casks and upgrade them if upgrades are available via –greedy flag.

      brew upgrade --cask --greedy
      
    • Get outdated cask info:

      brew outdated --cask --greedy --verbose