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 Extensions on the left panel.
  • Search for Remote - SSH, and install it. (What is SSH?)

SSH Login

  • Click Open Remote Window button at the left corner, select Connect to Host....
  • Click Add New SSH Host, make sure that the host file is saved into a path that you know.
  • Click Linux for 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-keygen to 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.

  • ls list all directory
  • cd change directory
  • mkdir make a directory
  • cp copy files
  • mv move files (rename)
  • cat print file
  • rm remove a file, rm -r remove a directory

Danger

  • rm should be used carefully because there is no “Recycle Bin” in Linux command line. Please be careful when executing rm *
  • echo print, echo $HOME print an environmental variable $HOME
  • vi vim, text editor in command line
  • grep search for string
  • | piping
  • man show manual for each command
  • wc counting
  • pwd show current directory
  • .. upper directory, . for current directory
  • gzip zip file, attach an extension of .gz; gunzip to unzip a .gz file
  • tarpacking all files into a single file
  • du show file size
  • clear clear the screen
  • touch create an empty file
  • passwd to change password
  • sed text processing. See here
  • scp and rsync, file sync

vim or vi for text editing

  • vi FILE, open a file for editing
  • \ search
  • shift+G go to the last line
  • i, enter edit mode for insertion
  • Ctrl+c quit any mode

: command line mode

  • w save file (in command line mode)
  • q quit vim, wq save and quit (in command line mode), q! quit without save
  • %s/old_word/new_word/g search and replace
  • any number: jump to this line