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 ... |
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access