Quick Linux Reference for the command-line
Directory navigation
Change the current directory to the desktop cd ~/Desktop Going up one directory cd ../ Going to a folder named folder in the current path cd folder
Compiling and running code
Compiling [Link] into an executable named code g++ -O2 -o code [Link] Running code ./code
Running code with input and output files
Running code with [Link] as the input file ./code < [Link] Running code with [Link] as the input file and writing the output to out ./code < [Link] > out Printing the contents of out cat out
Timing and verifying code
Running code with [Link] as the input file, and timing its execution time ./code < [Link] Running code with [Link] as the input file and writing the output to out, and timing its execution time ./code < [Link] > out Print all differences between [Link] and out diff [Link] out