The shell and the prompt
このページには最新のブラウザ(SharedArrayBuffer対応)が必要です。Chrome、Edge、Firefox、Safariを最新バージョンに更新してください。
プロンプト
- ターミナルが準備できると、プロンプトを表示して待機します:
student@linux:~$
- これはあなたが 誰か(
student)、コンピュータ(linux)、そして現在いるフォルダ(~、ご自宅ディレクトリ)を示しています。 $の後にコマンドを入力して Enter を押すと、コンピュータが実行します。
現在どこにいる?
- コマンド
pwdはあなたの現在のフォルダを出力します — 「你现在在这里」のようなものです:
pwd
- その例の ▶ を押して試してください。(
~はご自宅ディレクトリの略語であり、/home/studentです)。
コンピュータに話しかける
echoは入力した内容をそのまま表示するだけですが、これは古典的な最初のコマンドです:
echo Hello from the shell
- これを実行した後、以下の2つのタスクを試してください。
よくあるミス
- コマンドは大文字小文字を区別します:
LSとlsは異なります。 - Enter キーを押すと、シェルは各行ごとに1つのコマンドを実行します。
難易度 1/5 · 100 コイン + 今日初回達成時の小ボーナス
The prompt is waiting for a command. Type pwd (print working directory) to see which folder you are in, then click Run.
難易度 1/5 · 100 コイン + 今日初回達成時の小ボーナス
echo prints back whatever you give it. Use it to print the word hello.
難易度 1/5 · 100 コイン + 今日初回達成時の小ボーナス
The shell splits an unquoted line into words, so echo receives my かつ gap and joins them with one space. Put the text in double quotes to keep it as one word: print my gap with the three spaces, using echo "my gap".