1 .\" Copyright (c) 2002 Andries Brouwer <aeb@cwi.nl>
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date. The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein. The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" 2007-10-23 mtk Added intro paragraph about section, plus a paragraph
24 .\" about exit status values.
26 .\" Japanese Version Copyright (c) 2002 Akihiro MOTOKI, all rights reserved.
27 .\" Translated Mon Mar 5 2003 by Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
29 .\"WORD introduction 紹介
32 .TH INTRO 1 2007-11-15 "Linux" "Linux User's Manual"
34 .\"O intro \- Introduction to user commands
39 .\"O Section 1 of the manual describes user commands and tools,
40 .\"O for example, file manipulation tools, shells, compilers,
41 .\"O web browsers, file and image viewers and editors, and so on.
42 マニュアルの 1 章は、ユーザーコマンドやツールの説明について説明している。
43 例えば、ファイル操作ツール、シェル、コンパイラ、ウェブブラウザ、
44 ファイルやイメージのビューアやエディタ、などである。
46 .\"O All commands yield a status value on termination.
47 .\"O This value can be tested (e.g., in most shells the variable
49 .\"O contains the status of the last executed command)
50 .\"O to see whether the command completed successfully.
51 .\"O A zero exit status is conventionally used to indicate success,
52 .\"O and a nonzero status means that the command was unsuccessful.
53 .\"O (Details of the exit status can be found in
55 .\"O A nonzero exit status can be in the range 1 to 255, and some commands
56 .\"O use different nonzero status values to indicate the reason why the
58 すべてのコマンドは終了時にステータス値を返す。
59 この値を検査することで (例えば、ほとんどのシェルでは変数
61 に最後に実行したコマンドのステータスが保持される)、
62 そのコマンドが成功して完了したかどうかを知ることができる。
63 伝統的に、終了ステータス 0 は成功を示すのに使われ、非 0 の値は
68 非 0 の終了ステータスは 1 から 255 の範囲の値をとることができ、
69 いくつかのコマンドではコマンドが失敗した理由を示すために
70 複数の非 0 のステータス値が使用されている。
73 .\"O Linux is a flavor of UNIX, and as a first approximation
74 .\"O all user commands under UNIX work precisely the same under
75 .\"O Linux (and FreeBSD and lots of other UNIX-like systems).
76 Linux は UNIX の一種であり、大雑把にいえば、
77 UNIX 上のユーザコマンドはすべて Linux 上でも全く同じ動作をする
78 (FreeBSD や他のの多くの UNIX 風のシステムでも同様である)。
80 .\"O Under Linux there are GUIs (graphical user interfaces), where you
81 .\"O can point and click and drag, and hopefully get work done without
82 .\"O first reading lots of documentation.
83 .\"O The traditional UNIX environment
84 .\"O is a CLI (command line interface), where you type commands to
85 .\"O tell the computer what to do.
86 .\"O That is faster and more powerful,
87 .\"O but requires finding out what the commands are.
88 .\"O Below a bare minimum, to get started.
89 Linux には GUI (グラフィカル・ユーザ・インタフェース) が用意されており、
90 何かをポイントしたり、クリックしたり、ドラッグしたりでき、うまくいけば
91 最初にたくさんの文書を読まなくても目的の作業ができてしまうこともある。
92 伝統的な UNIX 環境は CLI (コマンド・ライン・インタフェース) であり、
93 コマンドを打ち込んで、コンピュータに何をすべきか教えてやる。
94 CLI は GUI よりも速く強力だが、どのコマンドが何をするのか知っている必要
95 がある。CLI を使い始めるために必要最小限のコマンドを以下に述べる。
98 .\"O In order to start working, you probably first have to login,
99 .\"O that is, give your username and password.
106 .\"O (command interpreter) for you.
107 .\"O In case of a graphical login, you get a screen with menus or icons
108 .\"O and a mouse click will start a shell in a window.
111 作業を開始するためには、ます最初にログインしなければならないだろう。
112 すなわち、ユーザ名とパスワードを入力しなければならない。詳しくは
116 プログラムは (コマンド・インタープリタである)
118 を起動する。グラフィカル・ログインの場合は、メニューやアイコンがある
119 スクリーンが表示され、マウスをクリックするとウィンドウが開いて
125 .\"O One types commands to the
127 .\"O the command interpreter.
128 .\"O It is not built-in, but is just a program
129 .\"O and you can change your shell.
130 .\"O Everybody has her own favorite one.
131 .\"O The standard one is called
133 コマンドは、コマンド・インタープリタである
137 は、組み込みコマンドではなく普通のプログラムであり、好みのものに変更する
138 ことができる。各人にはそれぞれ好みのシェルがある。標準のシェルは
154 .\"O A session might go like
159 .BI "knuth login: " aeb
160 .BI "Password: " ********
162 Tue Aug 6 23:50:44 CEST 2002
176 drwxrwxr\-x 2 aeb 1024 Aug 6 23:51 bin
177 \-rw\-rw\-r\-\- 1 aeb 37 Aug 6 23:52 tel
181 .BI "% " "cp tel tel2"
184 drwxr\-xr\-x 2 aeb 1024 Aug 6 23:51 bin
185 \-rw\-r\-\-r\-\- 1 aeb 37 Aug 6 23:52 tel
186 \-rw\-r\-\-r\-\- 1 aeb 37 Aug 6 23:53 tel2
187 .BI "% " "mv tel tel1"
190 drwxr\-xr\-x 2 aeb 1024 Aug 6 23:51 bin
191 \-rw\-r\-\-r\-\- 1 aeb 37 Aug 6 23:52 tel1
192 \-rw\-r\-\-r\-\- 1 aeb 37 Aug 6 23:53 tel2
193 .BI "% " "diff tel1 tel2"
195 .BI "% " "grep maja tel2"
201 .\"O and here typing Control-D ended the session.
202 ここで Control-D を打つとセッションが終了する。
205 .\"O here was the command prompt\(emit is the shell's way of indicating
206 .\"O that it is ready for the next command.
207 .\"O The prompt can be customized
208 .\"O in lots of ways, and one might include stuff like username,
209 .\"O machine name, current directory, time, etc.
210 .\"O An assignment PS1="What next, master? "
211 .\"O would change the prompt as indicated.
214 はコマンド・プロンプトである。コマンド・プロンプトはシェル独特のやり方で、
215 シェルが次のコマンドを受け付けられる状態になっていることを示している。
217 することができ、ユーザ名、マシン名、カレント・ディレクトリ、時刻などを
219 PS1="What next, master? " と設定すると、
222 .\"O We see that there are commands
224 .\"O (that gives date and time), and
226 .\"O (that gives a calendar).
235 .\"O lists the contents of the current directory\(emit tells you what
239 .\"O option it gives a long listing,
240 .\"O that includes the owner and size and date of the file, and the
241 .\"O permissions people have for reading and/or changing the file.
242 .\"O For example, the file "tel" here is 37 bytes long, owned by aeb
243 .\"O and the owner can read and write it, others can only read it.
244 .\"O Owner and permissions can be changed by the commands
249 コマンドはカレント・ディレクトリの内容をリスト表示する、つまり
250 ディレクトリ内にどんなファイルがあるかを教えてくれる。
252 オプションをつけて実行すると、詳細表示が行われ、
253 ファイルの所有者、サイズ、日付などが表示される。
254 上の例では、"tel" ファイルは、サイズが 37 バイトで、所有者は aeb で、
255 所有者は読み書きができ、他の人は読み出しだけができることが分かる。
256 ファイルの所有者と権限 (permission) は、それぞれ
264 .\"O will show the contents of a file.
265 .\"O (The name is from "concatenate and print": all files given as
266 .\"O parameters are concatenated and sent to "standard output", here
267 .\"O the terminal screen.)
270 (コマンド名は "concatenate and print" (連結して印字する) に由来している。
271 引数として与えられた全てのファイルの内容が連結され、「標準出力」
272 に送られる。上の例では、標準出力は端末のスクリーンである。)
276 .\"O (from "copy") will copy a file.
277 .\"O On the other hand, the command
279 .\"O (from "move") only renames it.
281 コマンドはファイルのコピーを行う (その名前は "copy" に由来する)。
285 (その名前は "move" に由来する)。
289 .\"O lists the differences between two files.
290 .\"O Here there was no output because there were no differences.
292 コマンドは 2 つのファイルの違いを表示する。
293 上の例では、二つのファイルに違いがないので、何も出力されていない。
297 .\"O (from "remove") deletes the file, and be careful! it is gone.
298 .\"O No wastepaper basket or anything.
299 .\"O Deleted means lost.
301 コマンドはファイルを削除する。ファイルはなくなってしまうので
302 注意して使用すること! ゴミ箱に相当するものはなく、
303 削除はそのファイルが完全に失われることを意味する。
307 .\"O (from "g/re/p") finds occurrences of a string in one or more files.
308 .\"O Here it finds Maja's telephone number.
310 コマンドは、指定された文字列を一つ以上のファイルから探す
311 (コマンド名は "g/re/p" に由来している)。
312 上の例では、Maja の電話番号が見つかっている。
313 .\"O .SS "Pathnames and the current directory"
315 .\"O Files live in a large tree, the file hierarchy.
318 .\"O describing the path from the root of the tree (which is called /)
320 .\"O For example, such a full pathname might be /home/aeb/tel.
321 .\"O Always using full pathnames would be inconvenient, and the name
322 .\"O of a file in the current directory may be abbreviated by only giving
323 .\"O the last component.
324 .\"O That is why "/home/aeb/tel" can be abbreviated
325 .\"O to "tel" when the current directory is "/home/aeb".
326 ファイルはファイル階層という大きな木の中にある。それぞれのファイルには
328 があり、パス名は (/ と呼ばれる) 木の根からの経路を示すものである。
329 上の例では、完全なパス名は /home/aeb/tel のようになる。
330 いつも完全なパス名を使うのは不便なので、カレント・ディレクトリにある
331 ファイル名は、ファイル名の最後の部分だけに省略することができる。
332 したがって、カレント・ディレクトリが "/home/aeb" の時は、 "/home/aeb/tel"
333 を "tel" に省略して書くことができる。
337 .\"O prints the current directory.
339 コマンドはカレント・ディレクトリを表示する。
343 .\"O changes the current directory.
344 .\"O Try "cd /" and "pwd" and "cd" and "pwd".
346 コマンドはカレント・ディレクトリを変更する。
347 "cd /"、"pwd"、"cd"、"pwd" と順に実行してみるとよい。
348 .\"O .SS "Directories"
352 .\"O makes a new directory.
358 .\"O removes a directory if it is empty, and complains otherwise.
360 コマンドは空であればディレクトリを削除し、
365 .\"O (with a rather baroque syntax) will find files with given name
366 .\"O or other properties.
367 .\"O For example, "find . \-name tel" would find
368 .\"O the file "tel" starting in the present directory (which is called ".").
369 .\"O And "find / \-name tel" would do the same, but starting at the root
371 .\"O Large searches on a multi-GB disk will be time-consuming,
372 .\"O and it may be better to use
375 コマンドは、指定された名前やその他の属性を持つファイルを探す
376 (書式はかなり変わっている)。例えば、"find . \-name tel" を実行すると、
377 "tel" という名前のファイルの検索をカレント・ディレクトリから開始する。
378 (カレント・ディレクトリは "." で表す)。"find / \-name tel" としても
379 同じことを行うが、検索は木の根 (/) から開始される。
380 数 GB のディスクに対して検索をかけると時間がかかるので、
384 .\"O .SS "Disks and Filesystems"
388 .\"O will attach the file system found on some disk (or floppy, or CDROM or so)
389 .\"O to the big file system hierarchy.
392 .\"O detaches it again.
395 .\"O will tell you how much of your disk is still free.
397 コマンドは、(フロッピーや CDROM などの) ディスク上のファイルシステムを
398 大きなファイルシステム階層に接続する。逆に
402 コマンドを実行すると、ディスクの未使用量がどの程度かを表示する。
405 .\"O On a UNIX system many user and system processes run simultaneously.
406 .\"O The one you are talking to runs in the
407 .\"O .IR foreground ,
408 .\"O the others in the
409 .\"O .IR background .
410 UNIX システムでは、多くのユーザプロセスとシステムプロセスが同時に実行される。
418 .\"O will show you which processes are active and what numbers these
422 により、どのプロセスが実行されているかやプロセスが持っている番号
426 .\"O allows you to get rid of them.
427 .\"O Without option this is a friendly
428 .\"O request: please go away.
429 .\"O And "kill \-9" followed by the number
430 .\"O of the process is an immediate kill.
433 を使うことで、プロセスを取り除くことができる。
434 オプションなしで実行されると、「いなくなって下さい」というやさしい要求
435 を行う。"kill \-9" に続けてプロセス番号を指定すると、指定したプロセスを
437 .\"O Foreground processes can often be killed by typing Control-C.
438 foreground プロセスは多くの場合 Control-C をタイプすることで
440 .\"O .SS "Getting information"
442 .\"O There are thousands of commands, each with many options.
444 それぞれのコマンドにはたくさんのオプションがある。
445 .\"O Traditionally commands are documented on
446 .\"O .IR "man pages" ,
447 .\"O (like this one), so that the command "man kill" will document
448 .\"O the use of the command "kill" (and "man man" document the command "man").
451 .\"O sends the text through some
455 .\"O Hit the space bar to get the next page, hit q to quit.
456 伝統的には、コマンドの説明は (このドキュメントもそうだが)
458 に書かれている。例えば "man kill" コマンドを実行すると、"kill" コマンドの
459 使い方に関する説明が表示される。(同様に "man man" は "man" コマンドに
469 次のページに進むにはスペース・キーを、終了するには q を押す。
471 .\"O In documentation it is customary to refer to man pages
472 .\"O by giving the name and section number, as in
474 .\"O Man pages are terse, and allow you to find quickly some forgotten
476 .\"O For newcomers an introductory text with more examples
477 .\"O and explanations is useful.
478 ドキュメントでは、他の man ページへの参照は
480 のように名前とセクション番号で示すのが一般的である。
481 man ページは簡潔に書かれており、詳細を忘れたときに素早く情報を見つける
482 ことができる。例や説明とともに入門向けの記載もあるので、初めての人にとっても
485 .\"O A lot of GNU/FSF software is provided with info files.
486 .\"O Type "info info"
487 .\"O for an introduction on the use of the program "info".
488 多くの GNU/FSF ソフトウェアには info ファイルが付属している。
489 "info info" とタイプすると、"info" プログラムの使い方の紹介が表示される。
491 .\"O Special topics are often treated in HOWTOs.
493 .\"O .I /usr/share/doc/howto/en
494 .\"O and use a browser if you find HTML files there.
495 特集記事については HOWTO で扱われることが多い。
496 .I /usr/share/doc/howto/en
498 HTML ファイルがあった場合はブラウザを使って表示すればよい。
500 .\" Actual examples? Separate section for each of cat, cp, ...?
501 .\" gzip, bzip2, tar, rpm