Ther Terminal is a simple program that uses a text-based interface (read, words) for file navigation and running programs.
Why use it: It makes file paths obvious, which is convenient for coding.
Essential commands:
ls= list filescd folder/= change directorycd ..= go up one levelmv {old/file} {new/file}= move file from old folder to new foldermv {old/} {new/}= rename directory from old to newpython file.py= run Python script called file.py
Shortcuts:
$,%,>= command prompt, whenever you open the terminal, this is the last symbol displayed by the terminal, you type your commands after it- Before the command prompt, terminals typically display the folder you are currently in.
~= your home folder, e.g./home/blake/is equivalent/= system root, the folder that contains all other folders.= current folder..= parent folder{x}= curly brackets often represent the path to the folder or file you want to manipulate. You don’t actually type the curly brackets into the terminal.- A path is either the location of a folder, or the location of a file.
- The Documents folder in my home folder has the path:
~/Documents//home/blake/Documents
- A file in my Documents folder called
ex.pyhas the path:~/Documents/ex.py/home/blake/Documents/ex.py