java-introcs StdOut.
If working, it will print 4 different data types.
(For old installer, use java StdOut.)
You can repeat with StdIn, StdDraw,
StdAudio. If not working, ask course staff.
Can be caused by moving/deleting files installed by installer.
myVeryLongNameDir, type cd m and then press Tab.
The rest will be typed automatically for you. (If there
are multiple possible completions, look at what is printed and/or press
Tab some more.) Extra useful for filenames with spaces.
| To do this: | Type on PC Command Prompt | Type on Mac Terminal |
|---|---|---|
| What is my current directory? | cd |
pwd |
| Show contents of current directory | dir |
ls |
Move to subdirectory "sub" (relative path) |
cd sub |
|
| Move to parent directory | cd .. |
Move to your user directory (absolute path) (Note different slashes!) |
cd \Users\username
(Use c: first if on different drive)
|
cd /Users/username |
View the contents of file "filename"* |
more filename |
|
Compile MyClass.java w/ Std libraries† |
javac-introcs MyClass.java
(For old installer javac MyClass.java)
|
|
Run program MyClass with Std libraries† |
java-introcs MyClass arg0 arg1 ...
(For old installer java MyClass arg0 arg1 ...)
|
|
Read standard input from file "infile"†* |
java-introcs MyClass arg0 arg1 ... < infile |
|
(Over)write standard output to file "outfile"†* |
java-introcs MyClass arg0 arg1 ... > outfile |
|
| Pipe: make output of 1st cmd input of 2nd | first command | second command |
|
| Examples of combining the above†* |
java HelloWorld | java-introcs Sort > hi.txt
java-introcs Sort < input.txt > output.txt
|
|
| Terminate program | Control-C (this is not Copy!) |
|
| Copy text (to clipboard) | Drag-select w/mouse, then Enter | Drag-select with mouse |
| Paste text (at current cursor) | Right-click in terminal/command prompt window | |
| End of typed-in standard input (EOF) | Control-Z on own line then Enter |
Control-D |
| For extra fun: delete, move, copy file make dir, remove dir, find text in file, append |
del move copy |
rm mv cp |