<<

L01 – The Terminal

• What is a terminal? o line interface with the computer. Text only. In the old days the terminal was the only interface to the computer. o Terminal, , , console, are all interchangeable words, as far as we’re concerned. o The terminal will be our programming environment, we won’t use IDE’s like Eclipse. • Using the terminal o Everything you can do using the Finder, such as navigate to different folders, files, create files and directories, can also be done via the terminal. o Navigating the system § “” – present working ; reports your current location in the § “

” – change directory; goes into a specified directory § “” – list; lists the contents of your pwd • “ls –alF” – the options “-alF” lists all files (even hidden files) with extra information. § “.” and “..” – shortcuts that refer to current directory, and up one level directory • e.g.: “cd ..” takes you up one level. “cd .” takes your to the current directory, effectively does nothing. § “~” is a that refers to your . For me its /Users/gregorychen3 o Making changes to the file system § “ ” – directory; creates a new directory (folder) called § “ ” – ; copies file located to . Hint: use “.” and “..” shortcuts to specify the file paths § “ ” – move; move a file located at to . Hint: use “.” and “..” shortcuts to specify the file paths § “ ” – remove; removes the file located at . • “rm –r ” – remove recursive; removes directory located at . o Other § “man ” – displays the manual for . For example, “man ls” obtains the manual page for the “ls” command. “q” to quit the man page. § “*” – matches any sequence of characters. • e.g.: “rm *” removes all files in the current directory, don’t do this. “rm *.class” removes all files that end with .class