Common Command

git

  • update last commit
git add --a
git commit --amend --no-edit
git push origin -f
  • pull rebase branch
git reset --hard origin/test
  • checkout remote origin
git checkout -b feature-branch origin/feature-branch
git switch -c feature-branch origin/feature-branch

docker

  • fix arm64 build on docker linux
docker run --privileged --rm tonistiigi/binfmt --install all
  • remove all docker
docker stop $(docker ps -aq)
docker container prune -f
docker image prune -f -a
docker volume prune -f -a
docker network prune -f
docker system prune

other

  • run process inject .env file
dotenvx run -- node index.js
  • show folder structure ignore node_modules and git
tree -I 'node_modules|.git'
  • find process by name
ps aux | grep mysql
  • find process by port
sudo netstat -nlp | grep :9200
  • find file by name
sudo find /etc -type f -name "*.yml"