Skip to content

Instantly share code, notes, and snippets.

@gabriel-rcpereira
Last active January 24, 2022 13:45
Show Gist options
  • Select an option

  • Save gabriel-rcpereira/26afd9352d49d429c16531a9a507a2f2 to your computer and use it in GitHub Desktop.

Select an option

Save gabriel-rcpereira/26afd9352d49d429c16531a9a507a2f2 to your computer and use it in GitHub Desktop.
Useful bash commands

Update all folders that have .git

find . -maxdepth 1 -type d -print -execdir git --git-dir={}/.git --work-tree=$PWD/{} pull origin master \;
  • find . searches the current directory
  • maxdepth 1 for a maximum depth of one sub-directory
  • type d to find directories, not files
  • execdir {} ; runs a custom command for every find
  • git --git-dir={}/.git --work-tree=$PWD/{} pull git pulls the individual directories

Reference

Find the process running on port

sudo lsof -n -i :3000 | grep LISTEN
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment