Open the current directory in applications: open .
Β / atom .
/ code .
Use curl to:
- download:
curl -O ftp://ftp.example.com/file.zip
- POST with multipart:
curl -v -F upload=@filename localhost:5000/api/upload
- POST with json:
curl -d '{"Name":"John"}' -H "Content-Type: application/json" -X POST localhost:3000/api/names
Get your IPv4 address: ipconfig getifaddr en0
Reboot: sudo shutdown -r now
Clear command history: history -c
Unzip in quieter mode: unzip -qq
Check the size of the directory: du -sh ~/myFolder
List all IP sockets using port 5000: lsof -i :5000
Kill process: kill -9Β `pid`
Display local computer name: hostname
Start a simple HTTP server:
python -m SimpleHTTPServer 8000
ruby -run -e httpd . -p 9000
Give you your last command: !!
Copy content to your clipboard: pbcopy < file
Permanently save ssh key in your .bashrc:
(so you don’t need to enter passphrase all the time when using git over ssh)
echo "ssh-add -K ~/.ssh/id_rsa 2> /dev/null" >> ~/.bashrc
- Remove remote file:
git rm -r --cached file
- Delete a local branch:
git branch -d branch
- Remove remote branch:
git push origin --deleteΒ branch
Find all files containing specific string:
grep -rnwl -e 'string' dirname
Disable MacOs Gatekeeper:
sudo spctl --master-disable
Show package versions for pip3:
pip3 freeze
Show proxy settings:
scutil --proxy
Remove agent from launchd:
launchctl remove com.coppertino.VOXAgent
Find and remove VOX agent from VOX:
launchctl list | grep VOX
launchctl remove com.coppertino.VOXAgent
Check Xcode version:
xcodebuild -version