Command Line Cheatsheet:
~
: The tilde means you’re in your user’s home directory, can be replaced with /users/<your_name>/
pwd
: pwd means print working directory - it tells us where we are.
ls
: check what directories are within the directory where you are standing by using
cd
: change directories by using the cd command.
cd ..
: to move up one directory.
cd ../..
: will bring you up two parent directories+ mkdir <directory-name>
: makes a new directory.
touch <file-name.extension>
: to create a file
atom <file-name or directory>
: open the file or directory with the atom text editor
open <file-name>
: open the file with the default program
- If this is a
.html
file it will open in the browser
- It’s like double clicking on the file
rm <file-name>
: To remove a file
mv <file to move> <final destination>
: to move a file to a new destination. You have to be in the same directory as the file you are moving. Also you have to list the path of directories in order to move the file to the final destination
- tab: completes the file name if in the directory
find <directory>
: Lists all of the sub-directories