Next: Introduction, Up: (dir) [Contents][Index]
このマニュアルは、GNU core utilities version 0.0 の詳細な解説である。 core utilities には、テキストやファイルを操作するための標準的なプログラムが入っている。
Copyright © 1994-2016 Free Software Foundation, Inc.
Japanese translation copyright © 2014-2017 Linux JM project
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled “GNU Free Documentation License”.
【訳者から御注意】 この文書を info コマンドで閲覧なさっている場合は、 行末に余計な文字が入って、読みにくいことがあるかもしれない。 そうしたときは、Ctrl キーと l (エル) キーを同時に押して、画面を再描画していただきたい。 たぶん、表示が正常になるはずである。
お手元の coreutils のバージョンが 0.0 以外の場合、 この文書の説明と動作が違うことがあるかもしれない (たとえば、この文書に書いてあるオプションが使えない、あるいは、 使えるはずのオプションの説明がないなど)。 そうした場合は、お使いの coreutils と同じバージョンの info マニュアルや man ページに当ってみていただきたい。そちらの方が正しいはずである。
| • Introduction: | 注意事項、概観、著者 | |
| • Common options: | 共通オプション | |
| • Output of entire files: | ファイル全体の出力 (cat tac nl od base32 base64) | |
| • Formatting file contents: | ファイルの整形 (fmt pr fold) | |
| • Output of parts of files: | ファイルの部分出力 (head tail split csplit) | |
| • Summarizing files: | チェックサムなど (wc sum b2sum cksum md5sum sha1sum sha2) | |
| • Operating on sorted files: | ソートなど (sort shuf uniq comm ptx tsort) | |
| • Operating on fields: | フィールド操作 (cut paste join) | |
| • Operating on characters: | 文字操作 (tr expand unexpand) | |
| • Directory listing: | ディレクトリ一覧 (ls dir vdir dircolors) | |
| • Basic operations: | 基本操作 (cp dd install mv rm shred) | |
| • Special file types: | 特殊ファイル型 (mkdir rmdir unlink mkfifo mknod ln link readlink) | |
| • Changing file attributes: | ファイルの属性変更 (chgrp chmod chown touch) | |
| • Disk usage: | ディスク使用量など (df du stat sync truncate) | |
| • Printing text: | テキストの表示 (echo printf yes) | |
| • Conditions: | 条件 (false true test expr) | |
| • Redirection: | リダイレクション (tee) | |
| • File name manipulation: | ファイル名の操作 (dirname basename pathchk mktemp realpath) | |
| • Working context: | 作業環境 (pwd stty printenv tty) | |
| • User information: | ユーザ情報 (id logname whoami groups users who) | |
| • System context: | システム情報 (date arch nproc uname hostname hostid uptime) | |
| • SELinux context: | SELinux コンテキスト (chcon runcon) | |
| • Modified command invocation: | 実行環境の変更 (chroot env nice nohup stdbuf timeout) | |
| • Process control: | プロセス制御 (kill) | |
| • Delaying: | 一時停止 (sleep) | |
| • Numeric operations: | 数値の操作 (factor numfmt seq) | |
| • File permissions: | アクセス・モード | |
| • Date input formats: | 日付文字列の指定法 | |
| • Opening the software toolbox: | ソフトウェア工具という考え方 | |
| • About the translation: | 翻訳について | |
| • GNU Free Documentation License: | Copying and sharing this manual | |
| • Concept index: | General index | |
— ノードの詳細なリスト — 共通オプション | ||
|---|---|---|
| • Exit status: | プログラムが実行に成功したか失敗したかの指標 | |
| • Backup options: | バックアップ・オプション | |
| • Block size: | ブロックサイズ | |
| • Floating point: | 浮動小数点数の表現 | |
| • Signal specifications: | シグナルの指定 | |
| • Disambiguating names and IDs: | chgrp, chown, chroot, id におけるユーザやグループの指定法 | |
| • Random sources: | ランダムデータのソース | |
| • Target directory: | 出力先ディレクトリ | |
| • Trailing slashes: | 末尾のスラッシュ | |
| • Traversing symlinks: | ディレクトリを指すシンボリックリンクのたどり方 | |
| • Treating / specially: | / (ルート) を特別扱いする | |
| • Standards conformance: | 規格への準拠 | |
| • Multi-call invocation: | Multi-call プログラムの起動 | |
ファイル全体の出力 | ||
| • cat invocation: | ファイルを結合して、書き出す | |
| • tac invocation: | ファイルを結合して、ファイルごとに逆順で書き出す | |
| • nl invocation: | 行番号を付けて、ファイルを書き出す | |
| • od invocation: | ファイルを 8 進数などの形式で書き出す | |
| • base32 invocation: | データを ASCII 文字で表示可能なデータに変換する | |
| • base64 invocation: | データを ASCII 文字で表示可能なデータに変換する | |
ファイル内容の整形 | ||
| • fmt invocation: | パラグラフに分かれたテキストを整形し直す | |
| • pr invocation: | ページ付けや段組みをしてファイルを表示する | |
| • fold invocation: | 入力行を指定された幅に合わせて折り返す | |
ファイルの部分出力 | ||
| • head invocation: | ファイルの先頭部分を出力する | |
| • tail invocation: | ファイルの末尾部分を出力する | |
| • split invocation: | ファイルを一定のサイズに分割する | |
| • csplit invocation: | ファイルを内容を目印にして分割する | |
ファイルの要約 | ||
| • wc invocation: | 行数、単語数、バイト数を表示する | |
| • sum invocation: | チェックサムとブロック数を表示する | |
| • cksum invocation: | CRC チェックサムとバイト数を表示する | |
| • b2sum invocation: | BLAKE2 ダイジェストの表示、または検査をする | |
| • md5sum invocation: | MD5 ダイジェストの表示、または検査をする | |
| • sha1sum invocation: | SHA-1 ダイジェストの表示、または検査をする | |
| • sha2 utilities: | SHA-2 ダイジェストの表示、または検査をする | |
ソートしたファイルの操作 | ||
| • sort invocation: | テキストファイルを並べ替える | |
| • shuf invocation: | テキストファイルをシャッフルする | |
| • uniq invocation: | ファイルから重複を省く | |
| • comm invocation: | ソート済みの二つのファイルを一行づつ比較する | |
| • ptx invocation: | ファイル内容の permuted index を作成する | |
| • tsort invocation: | トポロジカル・ソート | |
| ||
| • General options in ptx: | プログラム全体の動作に関係するオプション | |
| • Charset selection in ptx: | 使用している文字セットについて | |
| • Input processing in ptx: | 入力のフィールドと文脈、及びキーワードの選択 | |
| • Output formatting in ptx: | 出力フォーマットのタイプ、及びフィールドの幅 | |
| • Compatibility in ptx: | GNU による ptx の拡張
| |
フィールド操作 | ||
| • cut invocation: | 各行の選択した部分を表示する | |
| • paste invocation: | 複数のファイルの各行をマージする | |
| • join invocation: | 共通のフィールドに基づいて行を連結する | |
文字操作 | ||
| • tr invocation: | 文字の置換、圧縮、削除を行う | |
| • expand invocation: | タブをスペースに変換する | |
| • unexpand invocation: | スペースをタブに変換する | |
| ||
| • Character sets: | 文字集合の指定 | |
| • Translating: | ある文字集合を別の文字集合に変換する | |
| • Squeezing and deleting: | 文字の削除 | |
ディレクトリの一覧表示 | ||
| • ls invocation: | ディレクトリの内容を一覧表示する | |
| • dir invocation: | ディレクトリの内容を簡潔に表示する | |
| • vdir invocation: | ディレクトリの内容を詳細に表示する | |
| • dircolors invocation: | ls のカラー設定
| |
| ||
| • Which files are listed: | 表示対象にするファイル | |
| • What information is listed: | 表示する情報 | |
| • Sorting the output: | 出力のソート | |
| • Details about version sort: | バージョン・ソートの詳細 | |
| • General output formatting: | 出力全体の形式 | |
| • Formatting file timestamps: | タイムスタンプのフォーマット | |
| • Formatting the file names: | ファイル名のフォーマット | |
基本的なファイル操作 | ||
| • cp invocation: | ファイルやディレクトリをコピーする | |
| • dd invocation: | ファイルの変換とコピー | |
| • install invocation: | ファイルをコピーし属性をセットする | |
| • mv invocation: | ファイルの移動 (名前の変更) を行う | |
| • rm invocation: | ファイルやディレクトリを削除する | |
| • shred invocation: | セキュリティを向上させたファイルの削除 | |
特殊なファイル型 | ||
| • link invocation: | システムコール link を使って、ハードリンクを作成する | |
| • ln invocation: | ファイル間のリンクを作成する | |
| • mkdir invocation: | ディレクトリを作成する | |
| • mkfifo invocation: | FIFO (名前付きパイプ) を作成する | |
| • mknod invocation: | ブロック型やキャラクタ型のスペシャルファイルを作成する | |
| • readlink invocation: | シムリンクの値、または正規化されたファイル名を表示する | |
| • rmdir invocation: | 空のディレクトリを削除する | |
| • unlink invocation: | システムコール unlink を使って、ファイルを削除する | |
ファイルの属性変更 | ||
| • chown invocation: | ファイルの所有者やグループを変更する | |
| • chgrp invocation: | ファイルの所有グループを変更する | |
| • chmod invocation: | アクセス権を変更する | |
| • touch invocation: | ファイルのタイムスタンプを変更する | |
ディスク使用量 | ||
| • df invocation: | ファイルシステムのディスク使用状態を報告する | |
| • du invocation: | ファイルのディスク使用量を概算する | |
| • stat invocation: | ファイルやファイルシステムの状態を報告する | |
| • sync invocation: | キャッシュされた書き込みを永続的な記憶装置に同期する | |
| • truncate invocation: | ファイルサイズの短縮・伸長を行う | |
テキストの表示 | ||
| • echo invocation: | テキストを 1 行表示する | |
| • printf invocation: | データを整形して表示する | |
| • yes invocation: | 中断されるまで文字列を表示する | |
条件 | ||
| • false invocation: | 何もせず、実行失敗のステータスを返す | |
| • true invocation: | 何もせず、正常終了する | |
| • test invocation: | ファイルタイプのチェックや値の比較を行う | |
| • expr invocation: | 式を評価する | |
| ||
| • File type tests: | ファイルタイプのテスト | |
| • Access permission tests: | アクセス許可のテスト | |
| • File characteristic tests: | ファイル特性のテスト | |
| • String tests: | 文字列のテスト | |
| • Numeric tests: | 数値のテスト | |
| ||
| • String expressions: | 文字列式 (+ : match substr index length) | |
| • Numeric expressions: | 数式 (+ - * / %) | |
| • Relations for expr: | 論理結合と関係表現 (| & < <= = == != >= >) | |
| • Examples of expr: | expr の使用例
| |
リダイレクション | ||
| • tee invocation: | 出力を複数のファイルやプロセスにリダイレクトする | |
ファイル名操作 | ||
| • basename invocation: | ファイル名からディレクトリと接尾辞を取り除く | |
| • dirname invocation: | ファイル名から最後の要素を取り除く | |
| • pathchk invocation: | ファイル名の有効性や可搬性を検査する | |
| • mktemp invocation: | テンポラリファイルやディレクトリを作成する | |
| • realpath invocation: | ファイル名を展開して表示する | |
作業環境 | ||
| • pwd invocation: | 現在作業中のディレクトリを表示する | |
| • stty invocation: | 端末の諸特性を表示・変更する | |
| • printenv invocation: | 環境変数のすべて、あるいは一部を表示する | |
| • tty invocation: | 標準入力に接続している端末のファイル名を表示する | |
| ||
| • Control: | 制御関係の設定 | |
| • Input: | 入力に関する設定 | |
| • Output: | 出力に関する設定 | |
| • Local: | ローカル設定 | |
| • Combination: | 組み合わせ設定 | |
| • Characters: | 特殊文字 | |
| • Special: | 特殊設定 | |
ユーザ情報 | ||
| • id invocation: | ユーザの ID を表示する | |
| • logname invocation: | 現在のログイン名を表示する | |
| • whoami invocation: | 実効ユーザ ID を表示する | |
| • groups invocation: | ユーザが所属しているグループ名を表示する | |
| • users invocation: | 現在ログインしている全ユーザのログイン名を表示する | |
| • who invocation: | 現在誰がログインしているかを表示する | |
システム情報 | ||
| • arch invocation: | マシンのハードウェア名を表示する | |
| • date invocation: | システムの日付や時刻を表示、設定する | |
| • nproc invocation: | プロセッサ数を表示する | |
| • uname invocation: | システムについて情報を表示する | |
| • hostname invocation: | システム名を表示、設定する | |
| • hostid invocation: | 数値によるホストの識別名を表示する | |
| • uptime invocation: | システムの連続稼働時間と負荷を表示する | |
| ||
| • Time conversion specifiers: | 時刻関係の変換指定子 %[HIklMNpPrRsSTXzZ] | |
| • Date conversion specifiers: | 日付関係の変換指定子 %[aAbBcCdDeFgGhjmuUVwWxyY] | |
| • Literal conversion specifiers: | 文字変換指定子 %[%nt] | |
| • Padding and other flags: | 0 や空白による空き埋め、その他。 | |
| • Setting the time: | システムクロックの変更 | |
| • Options for date: | 現在時以外の指定 | |
| • Date input formats: | 日付文字列の指定法 | |
| • Examples of date: | 用例 | |
SELinux コンテキスト | ||
| • chcon invocation: | ファイルの SELinux コンテキストを変更する | |
| • runcon invocation: | 指定された SELinux コンテキストでコマンドを実行する | |
コマンド実行条件の変更 | ||
| • chroot invocation: | ルートディレクトリを変更して、コマンドを実行する | |
| • env invocation: | 変更した環境でコマンドを実行する | |
| • nice invocation: | niceness を変更して、コマンドを実行する | |
| • nohup invocation: | ハングアップ・シグナルで終了しないコマンドを実行する | |
| • stdbuf invocation: | 入出力バッファリングを変更して、コマンドを実行する | |
| • timeout invocation: | タイムリミット付きでコマンドを実行する | |
プロセス制御 | ||
| • kill invocation: | プロセスにシグナルを送る。 | |
一時停止 | ||
| • sleep invocation: | 指定された時間、停止する | |
数値の操作 | ||
| • factor invocation: | 素因数を表示する | |
| • numfmt invocation: | 数値を整形し直す | |
| • seq invocation: | 数列を表示する | |
| ||
| • General options in numfmt: | 一般オプション | |
| • Possible UNITs: | 使用できる UNIT | |
| • Examples of using numfmt: | numfmt の使用例 | |
ファイルの許可属性 | ||
| • Mode Structure: | ファイルのモードビットの構成 | |
| • Symbolic Modes: | ファイルのモードビットの憶えやすい表記 | |
| • Numeric Modes: | ファイルのモードビットの 8 進数による表記 | |
| • Directory Setuid and Setgid: | ディレクトリの Set-User-ID と Set-Group-ID ビット | |
日付入力の書式 | ||
| • General date syntax: | 共通規則 | |
| • Calendar date items: | 19 Dec 1994 | |
| • Time of day items: | 9:20pm | |
| • Time zone items: | EST, PDT, UTC, … | |
| • Combined date and time of day items: | 1972-09-24T20:02:00,000000-0500 | |
| • Day of week items: | Monday, Tuesday | |
| • Relative items in date strings: | next tuesday, 2 years ago | |
| • Pure numbers in date strings: | 19931219, 1440 | |
| • Seconds since the Epoch: | @1078100502 | |
| • Specifying time zone rules: | TZ="America/New_York", TZ="UTC0" | |
| • Authors of parse_datetime: | Bellovin, Eggert, Salz, Berets, et al. | |
ソフトウェアの道具箱 | ||
| • Toolbox introduction: | はじめに | |
| • I/O redirection: | I/O リダイレクション | |
| • The who command: | who コマンド
| |
| • The cut command: | cut コマンド
| |
| • The sort command: | sort コマンド
| |
| • The uniq command: | uniq コマンド
| |
| • Putting the tools together: | 工具を組み合わせる | |
翻訳について | ||
| • About the translation: | 翻訳について | |
Copying This Manual | ||
| • GNU Free Documentation License: | Copying and sharing this manual | |
Next: Introduction, Up: (dir) [Contents][Index]