OSDN Git Service

Convert release and draft pages to UTF-8.
[linuxjm/jm.git] / manual / LDP_man-pages / draft / man1 / intro.1
1 .\" Copyright (c) 2002 Andries Brouwer <aeb@cwi.nl>
2 .\"
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.
6 .\"
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.
11 .\"
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
18 .\" professionally.
19 .\"
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
22 .\"
23 .\" 2007-10-23 mtk Added intro paragraph about section, plus a paragraph
24 .\"     about exit status values.
25 .\"
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>
28 .\"
29 .\"WORD introduction 紹介
30 .\"WORD tree    木
31 .\"
32 .TH INTRO 1 2007-11-15 "Linux" "Linux User's Manual"
33 .\"O .SH NAME
34 .\"O intro \- Introduction to user commands
35 .SH 名前
36 intro \- ユーザーコマンドの紹介
37 .\"O .SH DESCRIPTION
38 .SH 説明
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 ファイルやイメージのビューアやエディタ、などである。
45
46 .\"O All commands yield a status value on termination.
47 .\"O This value can be tested (e.g., in most shells the variable
48 .\"O .I $?
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
54 .\"O .BR wait (2).)
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
57 .\"O command failed.
58 すべてのコマンドは終了時にステータス値を返す。
59 この値を検査することで (例えば、ほとんどのシェルでは変数
60 .I $?
61 に最後に実行したコマンドのステータスが保持される)、
62 そのコマンドが成功して完了したかどうかを知ることができる。
63 伝統的に、終了ステータス 0 は成功を示すのに使われ、非 0 の値は
64 そのコマンドが成功しなかったことを示す
65 (終了ステータスの詳細は
66 .BR wait (2)
67 に書かれている)。
68 非 0 の終了ステータスは 1 から 255 の範囲の値をとることができ、
69 いくつかのコマンドではコマンドが失敗した理由を示すために
70 複数の非 0 のステータス値が使用されている。
71 .\"O .SH NOTES
72 .SH 備考
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 風のシステムでも同様である)。
79 .LP
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 を使い始めるために必要最小限のコマンドを以下に述べる。
96 .\"O .SS "Login"
97 .SS ログイン
98 .\"O In order to start working, you probably first have to login,
99 .\"O that is, give your username and password.
100 .\"O See also
101 .\"O .BR login (1).
102 .\"O The program
103 .\"O .I login
104 .\"O now starts a
105 .\"O .I shell
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.
109 .\"O See also
110 .\"O .BR xterm (1).
111 作業を開始するためには、ます最初にログインしなければならないだろう。
112 すなわち、ユーザ名とパスワードを入力しなければならない。詳しくは
113 .BR login (1)
114 を参照のこと。
115 .I login
116 プログラムは (コマンド・インタープリタである)
117 .I "シェル (shell)"
118 を起動する。グラフィカル・ログインの場合は、メニューやアイコンがある
119 スクリーンが表示され、マウスをクリックするとウィンドウが開いて
120 シェルが起動されることだろう。詳しくは
121 .BR xterm (1)
122 を参照のこと。
123 .\"O .SS "The shell"
124 .SS シェル
125 .\"O One types commands to the
126 .\"O .IR shell ,
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
132 .\"O .IR sh .
133 コマンドは、コマンド・インタープリタである
134 .I シェル
135 に対して入力する。
136 .I シェル
137 は、組み込みコマンドではなく普通のプログラムであり、好みのものに変更する
138 ことができる。各人にはそれぞれ好みのシェルがある。標準のシェルは
139 .I sh
140 と呼ばれる。
141 .\"O See also
142 .\"O .BR ash (1),
143 .\"O .BR bash (1),
144 .\"O .BR csh (1),
145 .\"O .BR zsh (1),
146 .\"O .BR chsh (1).
147 .BR ash (1),
148 .BR bash (1),
149 .BR csh (1),
150 .BR zsh (1),
151 .BR chsh (1)
152 を参照のこと。
153 .LP
154 .\"O A session might go like
155 セッションの例を以下に示す。
156
157 .RS
158 .nf
159 .BI "knuth login: " aeb
160 .BI "Password: " ********
161 .BI "% " date
162 Tue Aug  6 23:50:44 CEST 2002
163 .BI "% " cal
164           August 2002
165 Su Mo Tu We Th Fr Sa
166              1  2  3
167  4  5  6  7  8  9 10
168 11 12 13 14 15 16 17
169 18 19 20 21 22 23 24
170 25 26 27 28 29 30 31
171
172 .BI "% " ls
173 bin  tel
174 .BI "% " "ls \-l"
175 total 2
176 drwxrwxr\-x   2 aeb       1024 Aug  6 23:51 bin
177 \-rw\-rw\-r\-\-   1 aeb         37 Aug  6 23:52 tel
178 .BI "% " "cat tel"
179 maja    0501\-1136285
180 peter   0136\-7399214
181 .BI "% " "cp tel tel2"
182 .BI "% " "ls \-l"
183 total 3
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"
188 .BI "% " "ls \-l"
189 total 3
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"
194 .BI "% " "rm tel1"
195 .BI "% " "grep maja tel2"
196 maja    0501\-1136285
197 .BI "% "
198 .fi
199 .RE
200
201 .\"O and here typing Control-D ended the session.
202 ここで Control-D を打つとセッションが終了する。
203 .\"O The
204 .\"O .B "% "
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.
212 ここで、
213 .B "% "
214 はコマンド・プロンプトである。コマンド・プロンプトはシェル独特のやり方で、
215 シェルが次のコマンドを受け付けられる状態になっていることを示している。
216 プロンプトは、柔軟にカスタマイズ
217 することができ、ユーザ名、マシン名、カレント・ディレクトリ、時刻などを
218 プロンプトに含めることができる。
219 PS1="What next, master? " と設定すると、
220 プロンプトはそのように変更されるだろう。
221 .LP
222 .\"O We see that there are commands
223 .\"O .I date
224 .\"O (that gives date and time), and
225 .\"O .I cal
226 .\"O (that gives a calendar).
227 例にあるように、
228 .I date
229 という日付と時刻を表示するコマンドや、
230 .I cal
231 というカレンダを表示するコマンドもある。
232 .LP
233 .\"O The command
234 .\"O .I ls
235 .\"O lists the contents of the current directory\(emit tells you what
236 .\"O files you have.
237 .\"O With a
238 .\"O .I \-l
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
245 .\"O .I chown
246 .\"O and
247 .\"O .IR chmod .
248 .I ls
249 コマンドはカレント・ディレクトリの内容をリスト表示する、つまり
250 ディレクトリ内にどんなファイルがあるかを教えてくれる。
251 .I \-l
252 オプションをつけて実行すると、詳細表示が行われ、
253 ファイルの所有者、サイズ、日付などが表示される。
254 上の例では、"tel" ファイルは、サイズが 37 バイトで、所有者は aeb で、
255 所有者は読み書きができ、他の人は読み出しだけができることが分かる。
256 ファイルの所有者と権限 (permission) は、それぞれ
257 .I chown
258 コマンドと
259 .I chmod
260 コマンドで変更できる。
261 .LP
262 .\"O The command
263 .\"O .I cat
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.)
268 .I cat
269 コマンドはファイルの内容を表示する。
270 (コマンド名は "concatenate and print" (連結して印字する) に由来している。
271 引数として与えられた全てのファイルの内容が連結され、「標準出力」
272 に送られる。上の例では、標準出力は端末のスクリーンである。)
273 .LP
274 .\"O The command
275 .\"O .I cp
276 .\"O (from "copy") will copy a file.
277 .\"O On the other hand, the command
278 .\"O .I mv
279 .\"O (from "move") only renames it.
280 .I cp
281 コマンドはファイルのコピーを行う (その名前は "copy" に由来する)。
282 一方、
283 .I mv
284 コマンドは単純にファイル名の変更を行う
285 (その名前は "move" に由来する)。
286 .LP
287 .\"O The command
288 .\"O .I diff
289 .\"O lists the differences between two files.
290 .\"O Here there was no output because there were no differences.
291 .I diff
292 コマンドは 2 つのファイルの違いを表示する。
293 上の例では、二つのファイルに違いがないので、何も出力されていない。
294 .LP
295 .\"O The command
296 .\"O .I rm
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.
300 .I rm
301 コマンドはファイルを削除する。ファイルはなくなってしまうので
302 注意して使用すること! ゴミ箱に相当するものはなく、
303 削除はそのファイルが完全に失われることを意味する。
304 .LP
305 .\"O The command
306 .\"O .I grep
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.
309 .I grep
310 コマンドは、指定された文字列を一つ以上のファイルから探す
311 (コマンド名は "g/re/p" に由来している)。
312 上の例では、Maja の電話番号が見つかっている。
313 .\"O .SS "Pathnames and the current directory"
314 .SS パス名とカレント・ディレクトリ
315 .\"O Files live in a large tree, the file hierarchy.
316 .\"O Each has a
317 .\"O .I "pathname"
318 .\"O describing the path from the root of the tree (which is called /)
319 .\"O to the file.
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 ファイルはファイル階層という大きな木の中にある。それぞれのファイルには
327 .I "パス名 (pathname)"
328 があり、パス名は (/ と呼ばれる) 木の根からの経路を示すものである。
329 上の例では、完全なパス名は /home/aeb/tel のようになる。
330 いつも完全なパス名を使うのは不便なので、カレント・ディレクトリにある
331 ファイル名は、ファイル名の最後の部分だけに省略することができる。
332 したがって、カレント・ディレクトリが "/home/aeb" の時は、 "/home/aeb/tel"
333 を "tel" に省略して書くことができる。
334 .LP
335 .\"O The command
336 .\"O .I pwd
337 .\"O prints the current directory.
338 .I pwd
339 コマンドはカレント・ディレクトリを表示する。
340 .LP
341 .\"O The command
342 .\"O .I cd
343 .\"O changes the current directory.
344 .\"O Try "cd /" and "pwd" and "cd" and "pwd".
345 .I cd
346 コマンドはカレント・ディレクトリを変更する。
347 "cd /"、"pwd"、"cd"、"pwd" と順に実行してみるとよい。
348 .\"O .SS "Directories"
349 .SS ディレクトリ
350 .\"O The command
351 .\"O .I mkdir
352 .\"O makes a new directory.
353 .I mkdir
354 コマンドはディレクトリを新規に作成する。
355 .LP
356 .\"O The command
357 .\"O .I rmdir
358 .\"O removes a directory if it is empty, and complains otherwise.
359 .I rmdir
360 コマンドは空であればディレクトリを削除し、
361 空でなければエラーメッセージを表示する。
362 .LP
363 .\"O The command
364 .\"O .I find
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
370 .\"O of the tree.
371 .\"O Large searches on a multi-GB disk will be time-consuming,
372 .\"O and it may be better to use
373 .\"O .BR locate (1).
374 .I find
375 コマンドは、指定された名前やその他の属性を持つファイルを探す
376 (書式はかなり変わっている)。例えば、"find . \-name tel" を実行すると、
377 "tel" という名前のファイルの検索をカレント・ディレクトリから開始する。
378 (カレント・ディレクトリは "." で表す)。"find / \-name tel" としても
379 同じことを行うが、検索は木の根 (/) から開始される。
380 数 GB のディスクに対して検索をかけると時間がかかるので、
381 そのようなときは
382 .BR locate (1)
383 を使った方がいいかもしれない。
384 .\"O .SS "Disks and Filesystems"
385 .SS ディスクとファイルシステム
386 .\"O The command
387 .\"O .I mount
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.
390 .\"O And
391 .\"O .I umount
392 .\"O detaches it again.
393 .\"O The command
394 .\"O .I df
395 .\"O will tell you how much of your disk is still free.
396 .I mount
397 コマンドは、(フロッピーや CDROM などの) ディスク上のファイルシステムを
398 大きなファイルシステム階層に接続する。逆に
399 .I umount
400 コマンドは切り離しを行う。
401 .I df
402 コマンドを実行すると、ディスクの未使用量がどの程度かを表示する。
403 .\"O .SS "Processes"
404 .SS プロセス
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 システムでは、多くのユーザプロセスとシステムプロセスが同時に実行される。
411 対話的に実行できるプロセスは
412 .I foreground
413 で実行されており、そうでないものは
414 .I background
415 で実行されている。
416 .\"O The command
417 .\"O .I ps
418 .\"O will show you which processes are active and what numbers these
419 .\"O processes have.
420 コマンド
421 .I ps
422 により、どのプロセスが実行されているかやプロセスが持っている番号
423 (プロセス番号) を表示できる。
424 .\"O The command
425 .\"O .I kill
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.
431 コマンド
432 .I kill
433 を使うことで、プロセスを取り除くことができる。
434 オプションなしで実行されると、「いなくなって下さい」というやさしい要求
435 を行う。"kill \-9" に続けてプロセス番号を指定すると、指定したプロセスを
436 直ちに削除する。
437 .\"O Foreground processes can often be killed by typing Control-C.
438 foreground プロセスは多くの場合 Control-C をタイプすることで
439 殺すことができる。
440 .\"O .SS "Getting information"
441 .SS 情報の探し方
442 .\"O There are thousands of commands, each with many options.
443 非常にたくさんのコマンドがあり、
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").
449 .\"O The program
450 .\"O .I man
451 .\"O sends the text through some
452 .\"O .IR pager ,
453 .\"O usually
454 .\"O .IR less .
455 .\"O Hit the space bar to get the next page, hit q to quit.
456 伝統的には、コマンドの説明は (このドキュメントもそうだが)
457 .I "man ページ"
458 に書かれている。例えば "man kill" コマンドを実行すると、"kill" コマンドの
459 使い方に関する説明が表示される。(同様に "man man" は "man" コマンドに
460 ついての説明を表示する。)
461 .I man
462 プログラムはテキストを
463 .I pager
464 に渡して表示を行う。
465 .I pager
466 として
467 .I less
468 が使われることが多い。
469 次のページに進むにはスペース・キーを、終了するには q を押す。
470 .LP
471 .\"O In documentation it is customary to refer to man pages
472 .\"O by giving the name and section number, as in
473 .\"O .BR man (1).
474 .\"O Man pages are terse, and allow you to find quickly some forgotten
475 .\"O detail.
476 .\"O For newcomers an introductory text with more examples
477 .\"O and explanations is useful.
478 ドキュメントでは、他の man ページへの参照は
479 .BR man (1)
480 のように名前とセクション番号で示すのが一般的である。
481 man ページは簡潔に書かれており、詳細を忘れたときに素早く情報を見つける
482 ことができる。例や説明とともに入門向けの記載もあるので、初めての人にとっても
483 役に立つものである。
484 .LP
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" プログラムの使い方の紹介が表示される。
490 .LP
491 .\"O Special topics are often treated in HOWTOs.
492 .\"O Look in
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
497 を見るといいだろう。
498 HTML ファイルがあった場合はブラウザを使って表示すればよい。
499 .\"
500 .\" Actual examples? Separate section for each of cat, cp, ...?
501 .\" gzip, bzip2, tar, rpm
502 .\"O .SH "SEE ALSO"
503 .SH 関連項目
504 .BR standards (7)