Skip to content

NPM & Terminal

kitiya edited this page Apr 10, 2020 · 3 revisions

NPM

Set up a new or existing npm package

npm init

Find the version of an installed npm package

npm list for local packages or npm list -g for globally installed packages.

npm list            // for local packages
npm list -g         // for global packages
npm list --depth=0  // view packages without their dependencies

TERMINAL

MAC Terminal Commands Cheat Sheet

Shortcuts

COMMAND DESC
Tab Auto-complete file and folder names
Ctrl + A Go to the beginning of the line you're currently typing on
Ctrl + E Go to the end of the line you're currently typing on
Ctrl + L Clear the screen
Ctrl + C Kill whatever you're running
Ctrl + D Exit the current shell
Option + → Move cursor one word forward
Option + ← Move cursor one word backward
Ctrl + _ Undo the last command

Basics

COMMAND DESC
/ (Forward Slash) Top level directory
. (Single Period) Current directory
.. (Double Period) Parent directory
~ (Tilde) Home directory
sudo [command] Run command with the security privileges of the super user
nano [file] Opens the Terminal editor
open [file] Opens a file
[command] -h Get help about a command
man [command] Show the help manual of the command

ZTM

  • ls

  • pwd

  • cd

  • cd..

  • clear

  • cd /

  • cd ~

  • cd <folder/folder/folder>

  • mkdir <folder>

  • open <folder>

  • touch index.html

  • open index.html

  • open -a "Sublime Text" index.html

  • rm <file>

  • rm -r <folder>

Clone this wiki locally