Environment tutorial
CSIE 梁祐承
If you installed MinGW, CLion will detect your compiler by default
Graphics user interface
Easy to use, more restrictions
Command line interface
Hard to use, more powerful
Run this command in Windows PowerShell first
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
(Password is not visible when typing, just type it & enter)
hint: you can access windows disks in WSL, mouted under /mnt/
command | meaning | description |
---|---|---|
ls | list | list files in directory |
pwd | print working directory | print current working directory |
cd | change directory | move to another directory |
mv | move | move a file / rename a file |
cp | copy | copy a file |
rm | remove | remove a file |
mkdir | make directory | make an empty directory |
apt | package manager to install new program |
# Install necessary software by apt (type your password when asked)
sudo apt update
sudo apt install gcc g++ make cmake vim build-essential -y
# Check where am I
pwd
# See what is in this directory
ls
# make a new directory named "hello"
mkdir hello
# go into new directory
cd hello
# check you're now in hello
pwd
# create an empty file named "test"
touch test
# check "test" exists
ls
# remove it
rm test
Vim is a command-line text editor, useful when doing server management (you'll need to edit many config files without GUI)
There are many plugins can make vim more friendly, feel free to discover it by yourself (We'll teach you basic operations in this course)
command | description |
---|---|
vim <file> (in shell) | Edit "filename" file with vim |
i | Go into insert mode to type |
ESC | Go into normal mode to run command |
:w | save (write) |
:q | quit |
:wq | save & quit |
:q! | quit without save |
u | undo |
ctrl + r | redo |
You can download this file into your $HOME as basic config
#include <stdio.h>
int main()
{
printf("Hello, Happy World!\n");
return 0;
}