Cheat Sheet: Command Line

 

Change directory

cd file location // change location

cd ~ // go back to primary location

cd .. // go back to parent location

keyboard short cut: Ctrl + U // clear whole command line

pwd // return the full path of current location

Edit Files

mkdir newFolder // create new folder, for create hidden folder, add . in front of the folder name

ls -a // list all files

touch text.text // create new file

open text.text // open file

open -a Notepad text.text // open file with specified application

rm text.text // delete file

rm * // delete all files in current location

rm -r myFolder/ // remove folder

0 Comments