Skip to content

Instantly share code, notes, and snippets.

@mdang
Last active December 17, 2020 18:46
Show Gist options
  • Save mdang/d87dea19e41ac808538040141223e9c8 to your computer and use it in GitHub Desktop.
Save mdang/d87dea19e41ac808538040141223e9c8 to your computer and use it in GitHub Desktop.
CLI Commands

Commands

pwd

cd

  • Discuss absolute and relative links
  • Use directory shortcuts '.', '..', '~' to navigate the filesystem
  • Use tab completion for navigating faster
  • Use CTRL + a to move to the beginning of the line
  • Use CTRL + e to move to the end of the line
  • Use OPTION <- or ESC, b to move back one word
  • Use OPTION -> ESC, f to move forward one word
  • From Finder, drop a folder into the terminal and the path to that file will populate on the command line

ls

  • Explain command options and how you can use them
  • ls -al

mkdir

  • Although not required, keep all folders and file names in lowercase, no spaces
  • Compare and contrast *nix file names vs Windows, and case sensitivity

touch

  • Use open to access the file as you would by double clicking it

man

cp

  • cp index.html index.bak

mv

  • Used to move or rename files
  • mv myfile.txt destination-directory

rm

subl / atom

nano / vim

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment