Skip to content

Commit

Permalink
pages.ja/*: add Japanese translation pages (#15693)
Browse files Browse the repository at this point in the history
  • Loading branch information
kawana77b authored Feb 7, 2025
1 parent 0daaf5a commit 27abf43
Show file tree
Hide file tree
Showing 37 changed files with 1,098 additions and 0 deletions.
16 changes: 16 additions & 0 deletions pages.ja/common/arp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# arp

> システムのARPキャッシュを表示し、操作します。
> もっと詳しく: <https://manned.org/arp>
- 現在のARPテーブルを表示する:

`arp -a`

- 特定のエントリを削除([d]elete)する:

`arp -d {{アドレス}}`

- ARPテーブルに新しいエントリを追加([s]et up)する:

`arp -s {{アドレス}} {{macアドレス}}`
36 changes: 36 additions & 0 deletions pages.ja/common/awk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# awk

> ファイル操作のための汎用プログラミング言語。
> もっと詳しく: <https://github.com/onetrueawk/awk>
- スペースで区切られたファイルの、5列目(別名フィールド)を表示する:

`awk '{print $5}' {{path/to/file}}`

- スペースで区切られたファイル中の、"foo"を含む行の2列目を表示する:

`awk '/{{foo}}/ {print $2}' {{path/to/file}}`

- ファイルの各行の最後の列を、フィールドの区切り文字として(スペースの代わりに)カンマを使って表示する:

`awk -F ',' '{print $NF}' {{path/to/file}}`

- ファイルの最初の列の値を合計し、合計を表示する:

`awk '{s+=$1} END {print s}' {{path/to/file}}`

- 1行目から3行目までを表示する:

`awk 'NR%3==1' {{path/to/file}}`

- 条件によって異なる値を表示する:

`awk '{if ($1 == "foo") print "Exact match foo"; else if ($1 ~ "bar") print "Partial match bar"; else print "Baz"}' {{path/to/file}}`

- 10列目の値が、最小値と最大値の間にある行を、全て表示する:

`awk '($10 >= {{min_value}} && $10 <= {{max_value}})'`

- UID>=1000であるユーザーの表を、コロンを区切り文字として、ヘッダと書式付き出力で表示する(`%-20s` は左寄せ文字列20文字を意味する。`%6s` は右寄せ文字列6文字を意味する。):

`awk 'BEGIN {FS=":";printf "%-20s %6s %25s\n", "Name", "UID", "Shell"} $4 >= 1000 {printf "%-20s %6d %25s\n", $1, $4, $7}' /etc/passwd`
21 changes: 21 additions & 0 deletions pages.ja/common/column.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# column

> `stdin` またはファイルを複数の列にフォーマットします。
> デフォルトの区切り文字は空白文字です。
> もっと詳しく: <https://manned.org/column>
- 30文字幅の表示用にコマンドの出力をフォーマットする:

`printf "header1 header2\nbar foo\n" | column --output-width {{30}}`

- カラムを自動的に分割し、表形式に自動整列する:

`printf "header1 header2\nbar foo\n" | column --table`

- `table`オプションにカラムの区切り文字を指定する(CSVの場合は","など) (デフォルトは空白文字):

`printf "header1,header2\nbar,foo\n" | column --table --separator {{,}}`

- 列を埋める前に行を埋める:

`printf "header1\nbar\nfoobar\n" | column --output-width {{30}} --fillrows`
20 changes: 20 additions & 0 deletions pages.ja/common/df.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# df

> ファイルシステムのディスク使用量の概要を表示します。
> もっと詳しく: <https://manned.org/df.1posix>
- 512バイト単位で全てのファイルシステムとそのディスク使用量を表示する:

`df`

- 指定したファイルまたはディレクトリを含むファイルシステムとそのディスク使用量を表示する:

`df {{path/to/file_or_directory}}`

- 1024バイト単位で表示する:

`df -k`

- 移植性のある方法で情報を表示する:

`df -P`
36 changes: 36 additions & 0 deletions pages.ja/common/find.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# find

> ディレクトリツリー下のファイルやディレクトリを再帰的に検索します。
> もっと詳しく: <https://manned.org/find>
- 拡張子でファイル検索する:

`find {{ルートパス}} -name '{{*.ext}}'`

- 複数のパス/名前パターンに一致するファイルを検索する:

`find {{ルートパス}} -path '{{*/path/*/*.ext}}' -or -name '{{*pattern*}}'`

- 大文字小文字を区別しないモードで、指定された名前にマッチするディレクトリを検索する:

`find {{ルートパス}} -type d -iname '{{*lib*}}'`

- 特定のパスを除いて、与えられたパターンにマッチするファイルを検索する:

`find {{ルートパス}} -name '{{*.py}}' -not -path '{{*/site-packages/*}}'`

- 与えられたサイズ範囲にマッチするファイルを検索し、再帰的な深さを"1"に制限する:

`find {{ルートパス}} -maxdepth 1 -size {{+500k}} -size {{-10M}}`

- 各ファイルに対してコマンドを実行する (ファイル名にアクセスするにはコマンド内で`{}`を使用):

`find {{ルートパス}} -name '{{*.ext}}' -exec {{wc -l}} {} \;`

- 今日変更されたすべてのファイルを検索し、その結果を引数として1つのコマンドに渡す:

`find {{ルートパス}} -daystart -mtime {{-1}} -exec {{tar -cvf archive.tar}} {} \+`

- 空のファイルまたはディレクトリを検索し、冗長に削除する:

`find {{ルートパス}} -type {{f|d}} -empty -delete -print`
37 changes: 37 additions & 0 deletions pages.ja/common/gpg.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# gpg

> GNU Privacy Guard。
> GNU Privacy Guard 2 については `gpg2` を参照してください。殆どのオペレーティングシステムは `gpg``gpg2` にシンボリックリンクしています。
> もっと詳しく: <https://gnupg.org>
- GPGの公開鍵と秘密鍵を対話的に作成する:

`gpg --full-generate-key`

- 暗号化せずに `doc.txt` に署名する (出力を `doc.txt.asc` に書き出す):

`gpg --clearsign {{doc.txt}}`

- [email protected][email protected]`doc.txt` を暗号化して署名する (`doc.txt.gpg` に出力):

`gpg --encrypt --sign --recipient {{[email protected]}} --recipient {{[email protected]}} {{doc.txt}}`

- パスフレーズのみで `doc.txt` を暗号化する (`doc.txt.gpg` に出力):

`gpg --symmetric {{doc.txt}}`

- `doc.txt.gpg` を復号化する (`stdout` に出力):

`gpg --decrypt {{doc.txt.gpg}}`

- 公開鍵をインポートする:

`gpg --import {{public.gpg}}`

- [email protected] 用に公開鍵をエクスポートする (`stdout` に出力):

`gpg --export --armor {{[email protected]}}`

- [email protected] の秘密鍵をエクスポートする (`stdout` に出力):

`gpg --export-secret-keys --armor {{[email protected]}}`
33 changes: 33 additions & 0 deletions pages.ja/common/gpg2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# gpg2

> GNU Privacy Guard 2。
> GNU Privacy Guard 1 については `gpg` を参照してください。
> もっと詳しく: <https://docs.releng.linuxfoundation.org/en/latest/gpg.html>
- インポートされたキーを一覧表示する:

`gpg2 --list-keys`

- 指定したファイルを指定した受信者のために暗号化し、`.gpg`を付加した新しいファイルに出力を書き出す:

`gpg2 --encrypt --recipient {{[email protected]}} {{path/to/doc.txt}}`

- 指定したファイルをパスフレーズのみで暗号化し、`.gpg`を付加した新しいファイルに出力を書き出す:

`gpg2 --symmetric {{path/to/doc.txt}}`

- 指定したファイルを復号し、結果を`stdout`に出力する:

`gpg2 --decrypt {{path/to/doc.txt.gpg}}`

- 公開鍵をインポートする:

`gpg2 --import {{path/to/public_key.gpg}}`

- 指定したメールアドレスの公開鍵を`stdout`にエクスポートする:

`gpg2 --export --armor {{[email protected]}}`

- 指定したメールアドレスの秘密鍵を`stdout`にエクスポートする:

`gpg2 --export-secret-keys --armor {{[email protected]}}`
36 changes: 36 additions & 0 deletions pages.ja/common/grep.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# grep

> 正規表現を使ってファイルのパターンを見つけます。
> もっと詳しく: <https://www.gnu.org/software/grep/manual/grep.html>
- ファイル内のパターンを検索する:

`grep "{{検索パターン}}" {{path/to/file}}`

- 正確な文字列を検索する(正規表現を無効にする):

`grep {{-F|--fixed-strings}} "{{正確な文字列}}" {{path/to/file}}`

- ディレクトリ内の全てのファイルを再帰的にパターン検索し、マッチしたファイルの行番号を表示する:

`grep {{-r|--recursive}} {{-n|--line-number}} --binary-files {{without-match}} "{{検索パターン}}" {{path/to/directory}}`

- 拡張正規表現 (`?`, `+`, `{}`, `()`, `|` をサポート)を大文字小文字を区別しないモードで使用する:

`grep {{-E|--extended-regexp}} {{-i|--ignore-case}} "{{検索パターン}}" {{path/to/file}}`

- 各マッチの前後3行のコンテキストを表示する:

`grep --{{context|before-context|after-context}} 3 "{{検索パターン}}" {{path/to/file}}`

- 各マッチのファイル名と行番号をカラー出力する:

`grep {{-H|--with-filename}} {{-n|--line-number}} --color=always "{{検索パターン}}" {{path/to/file}}`

- パターンにマッチする行を検索し、マッチしたテキストのみを表示する:

`grep {{-o|--only-matching}} "{{検索パターン}}" {{path/to/file}}`

- パターンにマッチしない行を `stdin` から検索する:

`cat {{path/to/file}} | grep {{-v|--invert-match}} "{{検索パターン}}"`
37 changes: 37 additions & 0 deletions pages.ja/common/kubectl.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# kubectl

> Kubernetes クラスタに対してコマンドを実行するためのコマンドラインインターフェイス。
> `run` のようないくつかのサブコマンドには、使用方法についての独自のドキュメントがあります。
> もっと詳しく: <https://kubernetes.io/docs/reference/kubectl/>
- リソースに関する情報をより詳細に一覧表示する:

`kubectl get {{pod|service|deployment|ingress|...}} -o wide`

- 指定したポッドにラベル 'unhealthy' と値 'true' を付けて更新する:

`kubectl label pods {{ポッド名}} unhealthy=true`

- 異なるタイプのリソースを全て一覧表示する:

`kubectl get all`

- ノードまたはポッドのリソース (CPU/Memory/Storage) 使用量を表示する:

`kubectl top {{pod|node}}`

- マスターとクラスタサービスのアドレスを表示する:

`kubectl cluster-info`

- 特定のフィールドの説明を表示する:

`kubectl explain {{pods.spec.containers}}`

- ポッドまたは指定したリソース内のコンテナのログを表示する:

`kubectl logs {{ポッド名}}`

- 既存のポッドでコマンドを実行する:

`kubectl exec {{ポッド名}} -- {{ls /}}`
33 changes: 33 additions & 0 deletions pages.ja/common/netstat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# netstat

> 開いている接続、開いているソケットポートなどのネットワーク関連情報を表示します。
> `ss` も参照してください。
> もっと詳しく: <https://manned.org/netstat>
- 全てのポートを一覧表示する:

`netstat --all`

- 全てのリスニングポートを一覧表示する:

`netstat --listening`

- リッスン中のTCPポートを一覧表示する:

`netstat --tcp`

- PIDとプログラム名を表示する:

`netstat --program`

- 情報を連続的に一覧表示する:

`netstat --continuous`

- ルートを一覧表示し、IPアドレスをホスト名に解決しない:

`netstat --route --numeric`

- リッスンしているTCPポートとUDPポートを一覧表示する (+ rootの場合はユーザーとプロセス):

`netstat --listening --program --numeric --tcp --udp --extend`
32 changes: 32 additions & 0 deletions pages.ja/common/ping.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# ping

> ICMP ECHO_REQUEST パケットをネットワークホストに送信します。
> もっと詳しく: <https://manned.org/ping>
- ホストをPingする:

`ping {{ホスト}}`

- ホストに特定の回数だけpingする:

`ping -c {{回数}} {{ホスト}}`

- リクエストの間隔を秒単位で指定して、ホストにpingする (デフォルトは1秒):

`ping -i {{秒数}} {{ホスト}}`

- アドレスのシンボリックネームを調べずに、ホストにpingする:

`ping -n {{ホスト}}`

- pingしてパケットを受信したら、ベルを鳴らす (端末がサポートしている場合):

`ping -a {{ホスト}}`

- 応答がない場合は、メッセージも表示する:

`ping -O {{ホスト}}`

- 特定のping回数、パケットごとの応答タイムアウト(`-W`)、ping実行全体の制限時間(`-w`)を指定して、ホストにpingする:

`ping -c {{回数}} -W {{秒数}} -w {{秒数}} {{ホスト}}`
37 changes: 37 additions & 0 deletions pages.ja/common/podman.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# podman

> ポッド、コンテナ、イメージのシンプルな管理ツールです。
> PodmanはDocker-CLIと互換性のあるコマンドラインを提供します。簡潔に言うと: `alias docker=podman`
> もっと詳しく: <https://github.com/containers/podman/blob/main/commands-demo.md>
- 全てのコンテナ(実行中と停止中の両方)を一覧表示する:

`podman ps --all`

- イメージから任意の名前でコンテナを作成する:

`podman run --name {{コンテナ名}} {{イメージ}}`

- 既存のコンテナを起動または停止する:

`podman {{start|stop}} {{コンテナ名}}`

- レジストリからイメージをプルする (デフォルトは Docker Hub):

`podman pull {{イメージ}}`

- 既にダウンロードされているイメージのリストを表示する:

`podman images`

- 既に起動しているコンテナ内でシェルを開く:

`podman exec --interactive --tty {{コンテナ名}} {{sh}}`

- 停止しているコンテナを削除する:

`podman rm {{コンテナ名}}`

- 1つまたは複数のコンテナのログを表示し、ログ出力を追跡する:

`podman logs --follow {{コンテナ名}} {{コンテナid}}`
Loading

0 comments on commit 27abf43

Please sign in to comment.