• 検索結果がありません。

bash on Ubuntu on Windows bash on Ubuntu on Windows bash on Ubuntu on Windows bash on Ubuntu on Windows bash on Ubuntu on Windows ˆ Windows10 64bit Wi

N/A
N/A
Protected

Academic year: 2021

シェア "bash on Ubuntu on Windows bash on Ubuntu on Windows bash on Ubuntu on Windows bash on Ubuntu on Windows bash on Ubuntu on Windows ˆ Windows10 64bit Wi"

Copied!
9
0
0

読み込み中.... (全文を見る)

全文

(1)
(2)

Windows

と比較しながら覚える

bash

on Ubuntu on Windows

入門

[Windows Creators Update(1703)

対応版

]

TAKE

 著

(3)

はじめに

bash on Ubuntu on Windowsって時々聞くけど、実際に何なのかよくわからない… 本書ではbash on Ubuntu on Windowsについて説明し、実際に使ってみることで「bash on

Ubuntu on Windows」を理解するための方法を解説しています。

bash on Ubuntu on Windows

を使うために必要なもの

bash on Ubuntu on Windowsを使用するためには、以下の要件が必要です。

ˆ Windows10の64bit版がインストールされていること

 Windows10のエディションはHome/Pro/Enterpriseのいずれでも構いません

 Windows10 32bit版ではbash on Ubuntu on Windowsは使用できません

ˆ Windows10のインストールされているパソコンが、インターネットに接続されていること

ˆ Windows10のバージョンが1607(Windows10 Anniversary Update)版以降であること

 Windows XP・ビスタ・7・8.1などの10より前のWindowsでは、bash on Ubuntu on

Windowsは使用できません

 Windows10の場合、Windows10のバージョン1607以降へのバージョンアップは無料 で可能です

こんな人におすすめ

!

ˆ bash on Ubuntu on Windowsという名前を時々聞くけど、実際に何なのかよくわからない

ˆ Ubuntuに興味があるから、普段使っているWindowsのパソコンでUbuntuを試してみたい

ˆ bashに興味があるから、普段使っているWindowsのパソコンでbashを試してみたい

注意事項

ˆ bash on Ubuntu on Windowsは執筆時点でβ版です。したがって、正常に動作しないコマ ンドがあります。

ˆ 本書はWindows10 Homeエディション 64bit 版 バージョン1703(Windows10 Creators

update)製品版、または同バージョンのWindows10 Insider previewにて動作確認をしてお ります

ˆ 本書に記載されている内容を実行した結果、万が一、直接的/間接的損害が生じても著者は

(4)

一切の責任を負いません

登録商標について

ˆ「Microsoft」は米国Microsoft Corporationの登録商標です

ˆ「Windows」は米国Microsoft Corporationの登録商標です

ˆ「Linux」はLinus Tovalds氏の米国およびその他の国における登録商標あるいは商標です

ˆ「Ubuntu」はCanonical Ltd. の登録商標です

ˆ その他、記載された会社名および製品名などはそれぞれ各社の商標または登録商標です

(5)

目次

はじめに i

bash on Ubuntu on Windowsを使うために必要なもの . . . i

こんな人におすすめ! . . . i

注意事項. . . i

登録商標について . . . ii

第1章 bash on Ubuntu on Windowsとは 1 1.1 Bashとは . . . 1

1.2 Ubuntuとは . . . 1

1.3 Windowsとは . . . 1

1.4 bash on Ubuntu on Windowsでできること . . . 2

1.5 bash on Ubuntu on Windowsでできないこと . . . 2

第2章 bash on Ubuntu on Windowsのインストール 4 2.1 開発者モードを有効にする. . . 4

2.2 Windows Subsystemを有効にする . . . 7

2.3 本体のインストール . . . 11

第3章 bash on Ubuntu on Windowsの起動と終了 15 3.1 起動. . . 15

3.2 終了. . . 16

第4章 bash on Ubuntu on Windowsを実際に使ってみる! 17 4.1 bash on Ubuntu on Windowsにおける操作 . . . 17

4.2 コマンドによる操作 . . . 17 4.3 管理者としての操作 . . . 18 sudo . . . 18 apt-get update. . . 19 apt-get install . . . 20 apt-get remove. . . 21 apt-get upgrade . . . 22 apt-get dist-upgrade . . . 23 do-release-upgrade . . . 24 iii

(6)

目次 4.4 ファイルの操作. . . 25 touch . . . 25 ls . . . 26 cp. . . 27 rm . . . 27 mkdir. . . 28 cd. . . 29 pwd. . . 29 rmdir . . . 30 4.5 テキストファイルの操作 . . . 31 nano . . . 31 cat . . . 34 more . . . 35 grep. . . 36 sed . . . 36 4.6 ネットワーク . . . 37 ssh . . . 37 ifcong . . . 38 ping. . . 39 4.7 プロセス/ジョブ . . . 40 ps . . . 40 top . . . 41 & . . . 41 ジョブとは . . . 42 表ジョブ、裏ジョブを実際に使ってみる! . . . 43 kill . . . 44 4.8 アプリ開発/プログラミング . . . 45 C言語 . . . 45 php . . . 46 Ruby . . . 47 python . . . 48 perl . . . 49 git . . . 50 4.9 Windowsプログラムの起動 . . . 50 Windowsプログラムを起動する. . . 51 第5章 おわりに 53 5.1 参考URL. . . 53 5.2 参考文献/書籍 . . . 54 5.3 お問い合わせ . . . 54

(7)

目次

5.4 サポートページ. . . 54

5.5 改定履歴 . . . 54

5.6 著者紹介 . . . 54

付録A Ubuntuを使ってみたくなったら 56 Windows上で、VirtualBOXにUbuntuをインストールしてみる . . . 56

ちょっと古くなったパソコンにUbuntuをインストールしてみる . . . 57

ラズベリーパイにOSをインストールしてみる . . . 58

VPSのような、Ubuntuをインストールできるサービスを使ってみる . . . 59

付録B bash on Ubuntu on WindowsとWindowsにおけるホームディレクトリのつ ながり 60 付録C bash on Ubuntu on Windowsのバージョンをアップする 66 C.1 バージョンを確認する . . . 66

C.2 バージョンをアップする . . . 67

(8)

1

bash on Ubuntu on Windows

とは

Bash on Ubuntu on Windows(バッシュ オン ウブンツ オン ウィンドウズ)とは、Windows上 で実行できるシェルのことです。

と、いきなり言われても理解するのは難しいかと思います。最初に、bash on Ubuntu on Windows の単語の一つ一つを説明していきます。

1.1

Bash

とは

Bash(バッシュ)とは、Linuxで使用するシェルの一つです。シェルとは、コンピュータで使用す るコマンドを実行するための環境です。Windowsではコマンドプロンプトやパワーシェルがシェル になります。 Linuxのシェルにはいくつかの種類があります。たとえば、C言語の文法をベースにしている csh(シーシェル)、最も基本的な機能を持つsh(シェル)があります。

Bash(バッシュ)は、その中でもshの機能を拡張したシェルです。BashはUbuntu Linuxという

OSでよく使用されています。

1.2

Ubuntu

とは

Ubuntu(ウブントゥ)は、Debian GNU/Linux をベースとしたオペレーティングシステム

(OS)である。Linuxディストリビューションの1 つであり、自由なソフトウェアとして提 供されている。 Wikipediahttps://ja.wikipedia.org/wiki/Ubuntuより Ubuntuとは、イギリスのカノニカル社が開発を支援しているオペレーティングシステムです。無 償で手に入れることが可能です。Debian GNU/LinuxというOSをベースに開発されています。

1.3

Windows

とは

Windows(ウィンドウズ)とは、米マイクロソフト社が開発および販売をしているパソコン用のオ ペレーティングシステムです。グラフィカルな画面で簡単に操作できます。

(9)

第1章bash on Ubuntu on Windowsとは 1.4 bash on Ubuntu on Windowsでできること

ˆ bashという、Ubuntuでよく使用されているシェルを

ˆ Windowsで使用することができるようにした機能 と言えます。

1.4

bash on Ubuntu on Windows

でできること

bash on Ubuntu on Windowsでは、以下のことが可能です。

ˆ Ubuntuのコマンドアプリケーションの使用

Ubuntuでは、本書で紹介する全てのコマンドが使用できます。bash on Ubuntu on Windowsで は一部、正常に動作しないコマンドがあります。

1.5

bash on Ubuntu on Windows

でできないこと

bash on Ubuntu on Windowsでは、以下のことができません。

ˆ Ubuntuのグラフィカルなアプリケーションの使用

UbuntuではWindowsのようなグラフィカルなアプリケーションを使用することができます。し かし、bash on Ubuntu on Windowsではグラフィカルなアプリケーションを使用することはでき ません。

図1.1 Ubuntuで起動しているグラフィカルなアプリケーションの画面

ˆ サーバプログラムを別のコンピュータから使用すること

図 1.1 Ubuntu で起動しているグラフィカルなアプリケーションの画面

参照

関連したドキュメント

MPIO サポートを選択すると、 Windows Unified Host Utilities によって、 Windows Server 2016 に含まれている MPIO 機能が有効になります。.

●お使いのパソコンに「Windows XP Service Pack 2」をインストールされているお客様へ‥‥. 「Windows XP Service

In 1992 Greither [10] refined the method of Rubin and used the Euler system of cyclotomic units to give an elementary (but technical) proof of the second version of the Main

In this paper we investigate some structure properties of the tail o-field and the invariant o-field of both homogeneous and nonhomogeneous Markov chains as representations

Specifically, if S {{Xnj j=l,2,...,kn }} is an infinitesimal system of random variables whose centered sums converge in distribution to some (infinitely divisible) random variable

Here we only present and prove an Orlicz norm version of the inequality (1.5) [and of its extension to the power weight case see, e.g., (2.6) with/3 1 + Zp and give an example of

One of the most classical characterizations of the real exponential function f(x)- e is the fact that the exponential function is the only (modulo a multiplicative constant)

'BOM for Windows Ver.8.0 インストールマニュアル'では、BOM for Windows