Skip to content

Instantly share code, notes, and snippets.

@Zia-
Last active May 15, 2017 07:48
Show Gist options
  • Save Zia-/29dd1d6f68cb72c367753f8e87e2ab17 to your computer and use it in GitHub Desktop.
Save Zia-/29dd1d6f68cb72c367753f8e87e2ab17 to your computer and use it in GitHub Desktop.
Terminal Commands useful on a daily basis
1. Trim terminal path:
PS1='\u:\W\$ '
OR
PS1='\W\$ '
2. Go to previous directory:
cd -
3. Kill Port process and free it:
sudo lsof -i :3000
// Assume it gave you 32122 port ID, then
kill -9 32122
4. cURL GET, POST, PUT, DELETE requests:
// GET
curl http://localhost:3000
// POST
curl -d 'buy pills' http://localhost:3000
// PUT
curl -X PUT http://localhost:3000/0?item=buy%20grocery
// DELETE
curl -X "DELETE" http://localhost:3000/1
5. Running Services - Ubuntu
service --status-all
6.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment