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, selectConnect 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 directorycd
change directorymkdir
make a directorycp
copy filesmv
move files (rename)cat
print filerm
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 executingrm *
echo
print,echo $HOME
print an environmental variable$HOME
vi
vim, text editor in command linegrep
search for string|
pipingman
show manual for each commandwc
countingpwd
show current directory..
upper directory,.
for current directorygzip
zip file, attach an extension of.gz
;gunzip
to unzip a.gz
filetar
packing all files into a single filedu
show file sizeclear
clear the screentouch
create an empty filepasswd
to change passwordsed
text processing. See herescp
andrsync
, file sync
vim
or vi
for text editing
vi FILE
, open a file for editing\
searchshift+G
go to the last linei
, enter edit mode for insertionCtrl+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