[Windows+Linux] WSL 사용 시 참고

Ubuntu 20.04 내의 파일 저장 경로

WSL 1

%localappdata%\Packages\CanonicalGroupLimited.Ubuntu20.04onWindows어쩌고저쩌고\LocalState\rootfs\

예를 들어, C:\Users\dasom\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu20.04onWindows_79rhkp1fndgsc\LocalState\rootfs

WSL 2

\\wsl$ 를 입력하면 배포판이 보인다.

\\wsl$\Ubuntu-20.04

GUI

Xming 같은 Xserver를 사용해서 WSL로 설치한 Ubuntu 등에서 GUI 를 사용할 수 있다.

WSL 1을 WSL 2로 변환하기

WSL로 설치한 항목은 다음으로 확인 가능하다.

wsl -l -v

여기서 WSL Version이 1인 것을 다음과 같이 2로 바꿀 수 있다. 예제로 Ubuntu-20.04 를 바꾸고 싶다면 다음과 같이 하면 된다.

wsl --set-version Ubuntu-20.04 2

실행 시 기본 유저 바꾸기

명령 프롬프트에서 다음을 실행한다.

ubuntu config --default-user new_dasomoli

참고

아래 글이 매우 정리가 잘 되어 있다.

[go] Ubuntu 에서 go 여러버전 사용하기

Ubuntu 리눅스에서 go의 여러 버전을 심볼릭 링크로 사용할 때 update-alternatives로 셋팅해서 사용하자.

# update-alternatives --install /usr/local/go go /usr/local/go1.17.2 1
update-alternatives: using /usr/local/go1.17.2 to provide /usr/local/go (go) in auto mode

# update-alternatives --install /usr/local/go go /usr/local/go1.16.8 2
update-alternatives: using /usr/local/go1.16.8 to provide /usr/local/go (go) in auto mode

# update-alternatives --install /usr/local/go go /usr/local/go1.14.15 3
update-alternatives: using /usr/local/go1.14.15 to provide /usr/local/go (go) in auto mode

# update-alternatives --config go
대체 항목 go에 대해 (/usr/local/go 제공) 3개 선택이 있습니다.

  선택       경로                우선순� 상태
------------------------------------------------------------
* 0            /usr/local/go1.14.15   3         자동 모드
  1            /usr/local/go1.14.15   3         수동 모드
  2            /usr/local/go1.16.8    2         수동 모드
  3            /usr/local/go1.17.2    1         수동 모드

현재 선택[*]을 유지하려면 <엔터>를 누르고, 아니면 선택 번호를 입력하시오:
#

[Docker] docker commands

실행 중인 docker process (machine) 보기

docker ps

실행 중 + 실행 중이 아닌 docker process 보기

docker ps -a

docker 이미지 보기

docker images

docker process 삭제

docker rm -rf [container name]

docker 이미지 삭제

docker rmi [image name]

docker 이미지 가져오기

docker pull [image name]

docker process 시작

docker start [container name]

docker process 중지

docker stop [container name]

실행 중인 모든 컨테이너 강제 종료

docker kill $(docker ps -q -f status=running)

실행 중인 모든 컨테이너 중지

docker stop $(docker ps -q -f status=running)

종료된 모든 컨테이너 삭제

docker rm $(docker ps -q -f status=exited)

시스템 상의 모든 이미지 삭제

docker image rm -f $(docker image ls -q)

docker 로그 보기

docker logs [container name]

docker network 삭제

docker network prune -f

alias해서 간편히 사용하기

alias dockerkill='docker kill $(docker ps -q -f status=running)'
alias dockerstop='docker stop $(docker ps -q -f status=running)'
alias dockerrm='docker rm $(docker ps -q -f status=exited)'
alias dockerimgrm='docker image rm -f $(docker image ls -q)'
alias dockernetprune='docker network prune -f'

docker cli 실행

$ docker exec -it cli /bin/bash

[English] Put on your shoes and put your shoes on (Two-Word Verbs 2)

two-word 동사(put on / take off, etc.)는 가끔 목적어object를 가진다. Sometimes a two-verb (put on / take off, etc.) has an object.

put on your coat
이렇게 쓸 수 있다:
put on your coat
put your coat on

take off your shoes
이렇게 쓸 수 있다:
take off your shoes
take your shoes off

그러나 it/them (대명사pronouns)는 언제나 on/off, etc. 앞에 온다. But it/them (pronouns) always go before on/off, etc:
put it on (not put on it)
take them off (not take off them)

  • It was cold, so I put on my coat. or … I put my coat on.
  • Here’s your coat. Put it on.
  • I’m going to take off my shoes. or … take my shoes off.
  • Your shoes are dirty. Take them off.

더 많은 two-word 동사verbs + 목적어object. More two-word verbs + objects

turn on / turn off (lights, machines, faucets, etc.)

  • It was dark, so I turned on the light. or … I turned the light on.
  • I don’t want to watch this program. You can turn it off.

pick up / put down

  • Those are my keys on the floor. Can you pick them up for me?
  • I stopped reading and put my book down. orput down my book.

bring back / take back / give back / put back

  • You can take my umbrella but please bring it back.
  • I took my new sweater back to the store. It was too small.
  • I have Diane’s keys. I have to give them back to her.
  • I read the letter and then put it back in the envelope.

[English] Go in, fall off, run away, etc. (Two-Word Verbs 1)

Two-word 동사는 동사 (go/look/be, etc.) + in/out/down, etc.이다. A two-word verb is a verb (go/look/be, etc.) + in/out/up/down, etc.

in

  • Erin opened the door of the car and got in. (= into the car)
  • I waited outside the house. I didn’t go in.

out

  • The car stopped and two women got out. (= out of the car)
  • I went to the window and looked out.

on

  • The bus came, and I got on.

off

  • Be careful! Don’t fall off.

up

  • He stood up and left the room.
  • I usually get up early. (= get out of bed)
  • We looked up at the stars.

down

  • Would you like to sit down?
  • The picture fell down.
  • Lie down on the floor.

away or off

  • The thief ran away. (or … ran off)
  • Erin got into the car and drove away. (ordrove off)

be/go away (= in/to another place)

  • Erin has gone away for a few days.

back

  • We went out for dinner and then went back to our hotel.
  • Go away and don’t come back!

be back

  • Erin is away. She’ll be back on Monday.

around

  • I’m not sure what kind of car I want. I want to look around first.
  • Somebody shouted my name, so I turned around.
  • We went for a long walk. After six miles we turned around and went back.

[English] Listen to …, look at …, etc. (Verb + Preposition)

ask somebody for

  • A man stopped me and asked me for money.

belong to

  • Does this book belong to you? (= Is this your book?)

happen to

  • I can’t find my pen. What happened to it?

listen to …

  • Listen to this music. It’s great!

look at

  • She’s looking at her watch.
  • Look at these flowers! They’re beautiful.
  • Why are you looking at me like that?

look for

  • He lost his key. He’s looking for it.
  • I’m looking for Sarah. Have you seen her?

speak/talk to somebody about

  • Did you talk to Paul about the problem?
  • (on the phone) Can I speak to Chris, please?

take care of

  • When Pat is at work, a friend of hers takes care of her children.
  • Don’t lose this book. Take care of it.

thank somebody for

  • Thank you very much for your help.

think about … or think of …

  • He never thinks about (or of) other people.
  • Mark is thinking of (or about) buying a new car.

wait for

  • Wait for me! I’m almost ready.

write and call

write (to) somebody

  • I never get letters. Nobody writes to me. (or Nobody writes me.)

call somebody (no preposition)

  • I have to call my parents. (not call to …)

depend

depend on으로 말한다. We say depend on …:

  • A: Do you like to eat in restaurants?
    B: Sometimes. It depends on the restaurant. (not it depends of)

on을 쓰거나 안써서 it depends what/where/how로 말할 수 있다. it depends what/where/how, etc., with or without on.

  • A: Do you want to go out with us?
    B: It depends where you’re going. (or It depends on where you’re going.)

[English] Afraid of, good at, etc. (Adjective + Preposition) At -ing, with -ing, etc (Preposition + -ing)

afraid of / good at, etc. (adjective + preposition)

afraid of …

  • Are you afraid of dogs?

angry/mad at somebody / angry/mad about something

  • Why are you mad at me? What did I do?
  • Are you angry about last night? (= something that happened last night)

different from … / different than …

  • Lynn is very different from her sister. or Lynn is very different than her sister.

full of …

  • The room was full of people.

good at … / bad at …

  • Are you good at math?
  • Tina is very bad at writing letters.

interested in …

  • I’m not interested in sports.

married to …

  • Sue is married to a dentist. (= her husband is a dentist)

nice/kind of somebody to … / nice/kind to somebody

  • It was kind of you to help us. Thank you very much.
  • David is very friendly. He’s always very nice to me.

sorry about something / sorry for somebody

  • I’m sorry about your accident. Was anyone hurt?
  • I feel sorry for them. They work hard, but they never have enough money.

tired of …

  • I’m tired of my job. I need a change.

Preposition + -ing

전치사preposition (at/with/for, etc.) 뒤에는 -ing 로 끝나는 동사. After a preposition (at/with/for, etc.), a verb ends in -ing.

I’m not very good at + telling + stories
Are you tried of + doing + the same thing every day?
Thank you for + helping + me.
Mark is thinking of + buying + a new car.
Tom left without + saying + goodbye. (= he didn’t say goodbye)
After + doing + the housework, they went out.

[English] On, at, by, with, and about

on

on vacation
on television
on the radio
on the phone
on fire
on time (= not late)

  • Tracy isn’t at work this week. She’s on vacation.
  • We watched the news on television.
  • We listened to the news on the radio.
  • I spoke to Carol on the phone last night.
  • The house is on fire! Call the fire department.
  • ”Was the train late?” “No, it was on time.”

at (the age of) 21 / at 50 kilometers an hour / at 100 degrees, etc.

  • Lisa got married at 21. (or … at the age of 21)
  • A car uses more gas at 70 miles an hour than at 55.
  • Water boils at 100 degrees Celsius.

by car / by bus / by plane (or by air) / by boat / by bicycle, etc.

  • Do you like traveling by train?
  • Can you get there by bike?

그러나 도보로는 on foot. But: on foot

  • You can’t get there by car. You have to go on foot.

a book by … / a painting by … / a piece of music by …, etc.
(the tile) by (the writer)

  • Have you read any books by Charles Dickens?
  • Who is that painting by? Picasso?

수동태 다음에 by. by after the passive

  • I was bitten by a dog.

with / without

  • Did you stay at a hotel or with friends?
  • Wait for me. Please don’t go without me.
  • Do you like your coffee with or without milk?
  • I cut the paper with a pair of scissors.

a main with a beard / a woman with glasses, etc.

  • Do you know that man with the beard?
  • I’d like to have a house with a big yard.

talk/speak/think/hear/know about …

  • Some people talk about their work all the time.
  • I don’t know much about cars.

a book / a question / a program (etc.) about

  • Did you see the program about computers on TV last night?