Install VS Code
Install the VS Code from here, please choose the correct platform and architecture, e.g. MacBook with Apple Silicon, you should install the arm64 version instead of x86/64.
- For Windows, you can find more information in WSL2.
Install VS Code Extension
- Open VS Code, find the
Extensionson the left panel. - Search for
Remote - SSH, and install it. (What is SSH?)
SSH Login
- Click
Open Remote Windowbutton at the left corner, selectConnect to Host.... - Click
Add New SSH Host, make sure that the host file is saved into a path that you know. - Click
Linuxfor your OS. By default, it is saved in$HOME/.ssh/config. - Use your password to login through SSH
Password
Use a stronger password for your account (mixture of small/capital letters, numbers, and symbols). You can find more information about password in security.
Use SSH key to login
ssh-keygento generate a set of public (.pub) and private keys
Some commonly used commands
You can learn more by searching Linux Shell Scripting on Google. There are lots of tutorials online. For example Introduction to the Unix Command Line from Cambridge University.
lslist all directorycdchange directorymkdirmake a directorycpcopy filesmvmove files (rename)catprint filermremove a file,rm -rremove a directory
Danger
rmshould be used carefully because there is no “Recycle Bin” in Linux command line. Please be careful when executingrm *
echoprint,echo $HOMEprint an environmental variable$HOMEvivim, text editor in command linegrepsearch for string|pipingmanshow manual for each commandwccountingpwdshow current directory..upper directory,.for current directorygzipzip file, attach an extension of.gz;gunzipto unzip a.gzfiletarpacking all files into a single filedushow file sizeclearclear the screentouchcreate an empty filepasswdto change passwordsedtext processing. See herescpandrsync, file sync
vim or vi for text editing
vi FILE, open a file for editing\searchshift+Ggo to the last linei, enter edit mode for insertionCtrl+cquit any mode
: command line mode
wsave file (in command line mode)qquit vim,wqsave and quit (in command line mode),q!quit without save%s/old_word/new_word/gsearch and replace- any number: jump to this line