LoginSignup
1
0

VSCodeのTerminalの使い方とCommand LineをHavard CS50の動画で学ぶ

Last updated at Posted at 2024-03-01

Harvard CS50の動画で、VSCodeの使い方を学ぶ

Harvard のプログラミングコースCS50を受講する際に、VSCodeの使い方について事前に勉強しておくと便利です。下記に、オフィシャルのYouTube動画のリンクそれからこの動画で学べる内容について、記載します。
18分ほどの動画です。
Visual Studio Code for CS50

VSCodeは、Cloud上のものを使う

動画内で使われるVSCodeは、GitHubのCode Space(cloud)、ウェブブラウザを使って、使用できるものです。環境などを1から自分で作る必要がないので、初心者がすぐにコーディングを勉強できるのでとてもお勧めです。下記サイトからGitHubアカウントにログインして使用します。
このサイトにログインする際にGit Hubアカウントが必要なので、事前に作成しておいてください。
Visual Studio Code for CS50

プログラミングを始める前のやることリスト

GitHubアカウントの作成以外にもやって置くといいことが他にもありますので、まとめて下記にやることリストを記載しておきます。これを事前にやっておくとスムーズに行くのでぜひやっておくことをお勧めします。

  1. Googleアカウントの作成
  2. GitHubアカウントの作成
  3. Chromブラウザのダウンロード

動画の内容は、Terminalを使って、ファイルやフォルダの作成移動など基本的なCommand Lineについての解説です。まだ使ったことがない人はぜひこの動画で勉強してみてください。
具体的なCommand lineの内容は下記に記載します。

学べるCommand Lineのリスト

ls
cp
mv
rm
mkdir
cd
rmdir
clear

1. Visual Studio Code for CS50

2. Getting Started

まだアカウントを持っていない場合は、GitHubアカウントの作成。

アカウント作成ができたら、code.cs50.ioにアクセスして、GitHubアカウントでログインします。

3. Visual Studio Code's Interface

4. Command-line Interface

Terminal
code hello.py
hello.py
print("hello, world")
Terminal
code hello.py
python hello.py

5. Unix Commands

ls list
cp copy
mv move or rename
rm remove
mkdir make a directory
cd change directory
rmdir remove directory
clear clear terminal window

6. Listing Files

Terminal
ls

7. Copying Files

Terminal
ls
cp hello.py goodbye.py
Terminal
ls
cp hello.py goodbye.py
code goodbye.py
hello.py
print("goodbye, world")

8. Renaming Files

Terminal
ls
cp hello.py goodbye.py
code goodbye.py
mv goodye.py farewell.py

9. Removing Files

Terminal
ls
cp hello.py goodbye.py
code goodbye.py
mv goodye.py farewell.py
rm far hit tab and enter
and hit y and hit enter

hit tab to autocomplete

10. Creating Folders

Terminal
ls
cp hello.py goodbye.py
code goodbye.py
mv goodye.py farewell.py
rm far hit tab and enter
and hit y and hit enter
clear
Terminal
mkdir folder

11. Changing Folders

Terminal
ls
cd folder/
folder/ ls
folder/ code farewell.py

12. Moving Files

Terminal
folder/ ls
folder/ mv farewell.py ..
folder/ ls
folder/ cd

13. Removing Folders

Terminal
ls
rmdir folder

14. Command History

Terminal
hit up to back through history of command
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0