Sunday, September 4, 2011

Basic DOS commands

Here are some basic DOS commands which should be helpful to you when you are working (compiling and running code) at the command line.

dir
    lists the files and directories in the current directory

cd\
    changes the working directory to root of the drive

cd..
    changes the working directory to the parent directory
    (the one above the current one)

cd [subdirectory]
    changes the working directory to the specified child directory
    (the one below the current one)

prompt $g
    shortens the prompt, you don't see the whole path

prompt $p$g
    shows the full path again

cls
    clear screen

del [file]
    deletes [file] there is no "are you sure?"

ren [old] [new]
    renames the file [old] to [new]

Java-specific commands
javac
    compiles .java source code

java
    runs .class bytecode

Command line