echo

エディターを開かずにテキストファイルを読み、行の絞り込み、行番号表示、先頭・末尾の制限ができます。

ファイルバージョン 1.2.2安定版エイリアス: read
lil-terminal

概要

echo はエディタを開かずにテキストを素早く確認できます。文字列または正規表現で検索し、元の行番号を専用列に表示し、結果の先頭または末尾だけに絞れます。

エディタを開かずにテキストを読む

echo はログや設定の素早い確認に向きます。テキスト絞り込み、行番号、先頭/末尾の制限で、エディターを開かずに済むことも多くあります。

構文

lil-terminal
echo <file> [text] [options]

リファレンス

echo <file>

テキストファイルの内容を表示

echo <file> "text"

"text" を含む行を表示

-i "text"

大文字・小文字を区別せず "text" を検索

-r "pattern"

PHP 正規表現で検索

-n

行番号付きでファイル内容を表示する

-h <lines>

先頭の <lines> 行を表示する

-t <lines>

末尾の <lines> 行を表示する

read <file>

echo <file> の別名

行単位の操作

-n は元の行番号を独立した列に保ちます。-h-t はフィルター後の結果から先頭または末尾の行だけを表示します。

別名

read は echo が提供する文書化済みの副コマンドです。同じ引数を受け取り、echo を削除すると read もなくなります。

制限

バイナリファイルは拒否されます。出力は行数と総サイズで制限され、途中で省略された場合はそのことが表示されます。

インタラクティブな sandbox プレビュー

用意された例をページ上でそのまま実行できます。結果は事前に生成されてブラウザに表示され、サーバーではターミナルコマンドを実行しません。

テキストファイルの内容を表示

インストールと管理

現在の互換バージョンをインストールします。全機能は Base、縮小版は Minimum を選び、すでに導入済みのモジュール更新には upgrade を使います。

Base と Minimum は同じ現在のモジュールリリースの二つのパッケージです。

Base パッケージ

ローカル参照と公開済みの全モードを含む完全パッケージをインストールします。

install echo
Minimum パッケージ

縮小パッケージをインストールします。ローカルリファレンスは含まれず、help <cmd> -i で現在のサーバーリファレンスを開きます。

install echo -m
正確な公開版

この公開済みバージョンを正確に指定してインストールします。

install echo -v 1.2.2
確認または更新

upgrade が互換性を確認し、必要な場合だけブロックを置換します。

upgrade echo
モジュールを削除

コアや他のモジュールに触れず拡張ブロックを削除します。

install echo -u

例はコピーできますが、サイトは実行しません。実プロジェクトではパス、権限、破壊的オプションを確認してください。

テキストファイルの内容を表示
cd \sandbox | echo data/sample.txt -h 3 | echo data/sample.txt "terminal" -i -n
4   It is never included in generated lil-terminal downloads and direct HTTP access is blocked.
Echo <file> の別名
read sandbox/data/sample.txt
lil-terminal sandbox text file

This file is safe to read, copy, rename, replace, hash and archive.

read は echo の副コマンドで、同じモジュールのバージョン系列を共有します。

行番号付きでファイル内容を表示する
echo sandbox/data/sample.txt -n
lil-terminal sandbox text file

This file is safe to read, copy, rename, replace, hash and archive.
大文字・小文字を区別せず "text" を検索
echo sandbox/data/sample.txt "terminal" -i -n
4   It is never included in generated lil-terminal downloads and direct HTTP access is blocked.
PHP 正規表現で検索
echo sandbox/logs/app.log -r "/error|warning/i" -n
3   This directory is part of the server tree: website_e36e9fed/sandbox/
4   It is never included in generated lil-terminal downloads and direct HTTP access is blocked.
先頭の <lines> 行を表示する
echo sandbox/data/sample.txt -h 3
lil-terminal documentation sandbox

This directory is part of the server tree: website_e36e9fed/sandbox/
末尾の <lines> 行を表示する
echo sandbox/data/sample.txt -t 3
During module review, examples may be refined together with the command. Keep paths
stable whenever possible because public documentation links refer to them.
テキストファイルの内容を表示
echo \sandbox\data\missing.txt
ファイルが見つかりません

この例で使うファイル: sandbox/data/sample.txt

例では、保護されたドキュメント用 /sandbox/ ワークスペースのファイルまたはディレクトリを使います。

lil-terminal sandbox text file

This file is safe to read, copy, rename, replace, hash and archive.

関連ドキュメント

現在の公開版

v1.2.22026-08-09

整理された echo リファレンス

検索、行番号、先頭・末尾の指定を通常のオプションとしてまとめました。