0% found this document useful (0 votes)
3 views

TerminalCheatSheet

This document is a terminal cheat sheet that provides essential commands for navigating and manipulating files in both OS X/Linux and Windows environments. It includes commands for printing the working directory, changing directories, listing contents, and managing files (deleting, moving, copying). Additionally, it covers how to run Java programs with input and output redirection.

Uploaded by

Near
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

TerminalCheatSheet

This document is a terminal cheat sheet that provides essential commands for navigating and manipulating files in both OS X/Linux and Windows environments. It includes commands for printing the working directory, changing directories, listing contents, and managing files (deleting, moving, copying). Additionally, it covers how to run Java programs with input and output redirection.

Uploaded by

Near
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Terminal Cheat Sheet

command results

pwd print working directory (OS X / Linux)


echo %cd% print current directory (Windows)

cd <new directory> change directory. e.g.:


cd .. (switch to parent directory)
cd subdirectory (relative path)
cd c:\Users\me (absolute path, Windows)
cd /Users/me (absolute path, OS X /Linux)

ls list contents of current directory (OS X / Linux)


dir list contents of current directory (Windows)

rm <filename> remove / delete a file (OS X / Linux)


del <filename> remove / delete a file (Windows)

mv <oldfile> <newfile> moves/renames oldfileto newfile(OS X)


move <oldfile> <newfile> moves/renames oldfileto newfile(Wind.)

cp <filename> <dupfile> makes a copy of filenamecalled dupefile


(OS X / Linux)
copy <filename> <dupfile> makes a copy of filenamecalled dupefile
(Windows)

mkdir <dirname> make directory dirnamein current directory

java MyProgram < inputFile runs MyProgram, taking input from inputFile

java MyProgram > outputFile runs MyProgram, writing output to outputFile


this will erase all previous contents of outputFile

You might also like