Navigation
pwd— show current directoryls— list filesls -la— list all files with detailscd foldername— go into a foldercd ..— go back one levelcd ~— go to home directorycd a/b/c— string
Files & Folders
touch file.txt— create a filemkdir foldername— create a folder-
rm -rf foldername— delete a folder
rm file.txt— delete a filecp file.txt dest/— copy a filemv file.txt dest/— move or rename a filecat file.txt— print file contentsvim foldername— open vim editorvim -0 file.txt file.txt— vertical split
Inside vim
-
:vsplit— split vertically -
Ctrl+w =— equal split -
Ctrl+w w— switch between splits -
:w— save -
:q— quit -
:wq— save and quit -
:q!— quit without saving -
:start,end d— delete lines -
javac *.java— compile all bottom-up javac —enable-preview —release 21 *.java -
jshell file.java file.java— in dependency order
jshell
jshell # start jshell
/exit # quit
/open file.java # load a java file into jshell
Ctrl + D # end jshell
Things to declare
private static final double EPSILON = 1E-15;
Questions
- When to use private / final / static etc?