- find ~ -type f -name '*pdf'
- find ~ -iname '*pdf'
Search specific type of file in current folder
- find . -iname '*pdf'
Make file executable
- chmod +x file.xx'
Run PHPFixer on current folder
- php-cs-fixer fix --diff --dry-run --stop-on-violation -v --using-cache=no
- php-cs-fixer fix --stop-on-violation -v --using-cache=no
Make your git branch prefix
- curl https://gist.githubusercontent.com/bartoszmajsak/1396344/raw/bff6973325b159254a3ba13c5cb9ac8fda8e382b/prepare-commit-msg.sh > .git/hooks/prepare-commit-msg && chmod u+x .git/hooks/prepare-commit-msg
- copied from https://stackoverflow.com/questions/42950501/delete-node-modules-folder-recursively-from-a-specified-path-using-command-line
- find . -name 'node_modules' -type d -prune -print -exec rm -rf '{}' \;
Open a very large file like log files
- tail -500 bigfile | less
Show hidden files in mac
- defaults write com.apple.Finder AppleShowAllFiles true
- killall Finder
Add entries to a file by using export
echo 'export PATH="/usr/local/opt/php@8.0/bin:$PATH"' >> ~/.zshrc
echo 'export PATH="/usr/local/opt/php@8.0/sbin:$PATH"' >> ~/.zshrc
Install Python
- brew install pyenv
- pyenv install 2.7.18
- pyenv global 2.7.18
0 comments:
Post a Comment