Common Commands

Here are some of the most common commands you’ll use at the shell:

java

Run Java classes and Java archives (jars) as a program

javac

Compile Java source code to class files

cd

Change the directory

pwd

Print the working (current) directory

ls

List files in the current directory

cat

Display the contents of a file

echo

Display text; also display environment variables using the $ prefix

mkdir

Make a new directory

cp

Copy a file

mv

Move a file

rm

Remove (delete) a file permanently (Use this with extreme caution; this is not the same as the Trash, and there is no “undo.”)

chmod

Change file permissions (including read, write, and execute)

.

(single dot) Means the current directory

..

(two dots) Means the parent directory

~

(tilde) Means ...

Get Learn to Program with Minecraft Plugins, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.