使用法: ls [オプション]... [ファイル]...
List information about the FILEs (the current directory by default).
Sort entries alphabetically if none of -cftuvSUX nor --sort.
長いオプションに必須の引数は短いオプションにも必須です.
-a, --all do not ignore entries starting with .
-A, --almost-all do not list implied . and ..
--author with -l, print the author of each file
-b, --escape print octal escapes for nongraphic characters
--block-size=SIZE use SIZE-byte blocks. See SIZE format below
-B, --ignore-backups do not list implied entries ending with ~
-c with -lt: sort by, and show, ctime (time of last
modification of file status information)
with -l: show ctime and sort by name
otherwise: sort by ctime
-C list entries by columns
--color[=WHEN] colorize the output. WHEN defaults to `always'
or can be `never' or `auto'. More info below
-d, --directory list directory entries instead of contents,
and do not dereference symbolic links
-D, --dired generate output designed for Emacs' dired mode
-f do not sort, enable -aU, disable -ls --color
-F, --classify append indicator (one of */=>@|) to entries
--file-type likewise, except do not append `*'
--format=WORD across -x, commas -m, horizontal -x, long -l,
single-column -1, verbose -l, vertical -C
--full-time like -l --time-style=full-iso
-g like -l, but do not list owner
--group-directories-first
group directories before files.
augment with a --sort option, but any
use of --sort=none (-U) disables grouping
-G, --no-group in a long listing, don't print group names
-h, --human-readable with -l, print sizes in human readable format
(e.g., 1K 234M 2G)
--si likewise, but use powers of 1000 not 1024
-H, --dereference-command-line
follow symbolic links listed on the command line
--dereference-command-line-symlink-to-dir
follow each command line symbolic link
that points to a directory
--hide=PATTERN do not list implied entries matching shell PATTERN
(overridden by -a or -A)
--indicator-style=WORD append indicator with style WORD to entry names:
none (default), slash (-p),
file-type (--file-type), classify (-F)
-i, --inode print the index number of each file
-I, --ignore=PATTERN do not list implied entries matching shell PATTERN
-k like --block-size=1K
-l 詳細リスト形式を表示する
-L, --dereference シンボリックリンクのファイル情報を表示するときは
リンクそのものではなくリンク参照先のファイル
情報を表示する
-m 項目のリストをカンマで区切り、一行に詰め込む
-n, --numeric-uid-gid like -l, but list numeric user and group IDs
-N, --literal print raw entry names (don't treat e.g. control
characters specially)
-o like -l, but do not list group information
-p, --indicator-style=slash
append / indicator to directories
-q, --hide-control-chars 表示不可能な文字を ? に置き換える
--show-control-chars 表示不可能な文字をそのまま表示 (プログラムが
`ls' でなかったり出力が端末でない場合の初期状態)
-Q, --quote-name ファイル名をダブルクォート(")で囲む
--quoting-style=WORD 項目名のクォートに WORD 文字を使う:
literal, locale, shell, shell-always, c, escape
-r, --reverse reverse order while sorting
-R, --recursive list subdirectories recursively
-s, --size print the allocated size of each file, in blocks
-S sort by file size
--sort=WORD sort by WORD instead of name: none -U,
extension -X, size -S, time -t, version -v
--time=WORD with -l, show time as WORD instead of modification
time: atime -u, access -u, use -u, ctime -c,
or status -c; use specified time as sort key
if --sort=time
--time-style=STYLE with -l, show times using style STYLE:
full-iso, long-iso, iso, locale, +FORMAT.
FORMAT is interpreted like `date'; if FORMAT is
FORMAT1
Usage: ls [OPTION]... [FILE]...
List information about the FILEs (the current directory by default).
Sort entries alphabetically if none of -cftuvSUX nor --sort.
Mandatory arguments to long options are mandatory for short options too.
-a, --all do not ignore entries starting with .
-A, --almost-all do not list implied . and ..
--author with -l, print the author of each file
-b, --escape print octal escapes for nongraphic characters
--block-size=SIZE use SIZE-byte blocks. See SIZE format below
-B, --ignore-backups do not list implied entries ending with ~
-c with -lt: sort by, and show, ctime (time of last
modification of file status information)
with -l: show ctime and sort by name
otherwise: sort by ctime
-C list entries by columns
--color[=WHEN] colorize the output. WHEN defaults to `always'
or can be `never' or `auto'. More info below
-d, --directory list directory entries instead of contents,
and do not dereference symbolic links
-D, --dired generate output designed for Emacs' dired mode
-f do not sort, enable -aU, disable -ls --color
-F, --classify append indicator (one of */=>@|) to entries
--file-type likewise, except do not append `*'
--format=WORD across -x, commas -m, horizontal -x, long -l,
single-column -1, verbose -l, vertical -C
--full-time like -l --time-style=full-iso
-g like -l, but do not list owner
--group-directories-first
group directories before files.
augment with a --sort option, but any
use of --sort=none (-U) disables grouping
-G, --no-group in a long listing, don't print group names
-h, --human-readable with -l, print sizes in human readable format
(e.g., 1K 234M 2G)
--si likewise, but use powers of 1000 not 1024
-H, --dereference-command-line
follow symbolic links listed on the command line
--dereference-command-line-symlink-to-dir
follow each command line symbolic link
that points to a directory
--hide=PATTERN do not list implied entries matching shell PATTERN
(overridden by -a or -A)
--indicator-style=WORD append indicator with style WORD to entry names:
none (default), slash (-p),
file-type (--file-type), classify (-F)
-i, --inode print the index number of each file
-I, --ignore=PATTERN do not list implied entries matching shell PATTERN
-k like --block-size=1K
-l use a long listing format
-L, --dereference when showing file information for a symbolic
link, show information for the file the link
references rather than for the link itself
-m fill width with a comma separated list of entries
-n, --numeric-uid-gid like -l, but list numeric user and group IDs
-N, --literal print raw entry names (don't treat e.g. control
characters specially)
-o like -l, but do not list group information
-p, --indicator-style=slash
append / indicator to directories
-q, --hide-control-chars print ? instead of non graphic characters
--show-control-chars show non graphic characters as-is (default
unless program is `ls' and output is a terminal)
-Q, --quote-name enclose entry names in double quotes
--quoting-style=WORD use quoting style WORD for entry names:
literal, locale, shell, shell-always, c, escape
-r, --reverse reverse order while sorting
-R, --recursive list subdirectories recursively
-s, --size print the allocated size of each file, in blocks
-S sort by file size
--sort=WORD sort by WORD instead of name: none -U,
extension -X, size -S, time -t, version -v
--time=WORD with -l, show time as WORD instead of modification
time: atime -u, access -u, use -u, ctime -c,
or status -c; use specified time as sort key
if --sort=time
--time-style=STYLE with -l, show times using style STYLE:
full-iso, long-iso, iso, locale, +FORMAT.
FORMAT is interpreted like `date'; if FORMAT is
FORMAT1
LS(1) LS(1) 名前 ls, dir, vdir - ディレクトリの中身をリスト表示する 書式 ls [options] [file...] POSIX オプション: [-CFRacdilqrtu1] GNU オプション (簡略形式): [-1abcdfghiklmnopqrstuvxABCDFGHLNQRSUX] [-w cols] [-T cols] [-I pattern] [--block-size=SIZE] [--classify] [--color[={none,always,auto}]] [--file-type] [--full-time] [--for- mat={across,commas,long,single-column,verbose,vertical}] [--human-read- able] [--indicator-style={none,file-type,classify}] [--quot- ing-style={c,clocale,escape,literal,locale,shell,shell-always}] [--show-control-chars] [--si] [--sort={none,extension,size,time,ver- sion}] [--time={atime,access,ctime,status,use}] [--help] [--version] [--] 説明 プ ログラム ls は、最初にディレクトリでない引き数 file をリスト表示する 。それから、ディレクトリである引き数について、それぞれのディレクトリ に あ るリスト表示可能なすべてのファイルを表示する。オプション以外の引き数 が何もない場合、デフォルトの引き数として ‘.’ (現在のディレクトリ) を仮 定 する。 -d オプションは、ディレクトリをディレクトリでない引き数として 扱わせるようにする。ファイル名が ‘.’ で始まっていなければ、そのファイル は 表示される。 ‘.’ で始まる名前のファイルでも、-a オプションが指定され ていれば表示される。 それぞれのファイルリスト (ディレクトリでないファイルのリストと各ディ レ ク トリ内のファイルのリスト) は、現在のロケールにおける文字の順序に従っ て個別にソートされる。 -l オプションが指定された場合、リスト中の全フ ァ イ ルの合計サイズを表示する要約行が各リストの前に付加される。このサイズ は選択されているブロックサイズを単位とする数値になる。 出力は標準出力に対して行われ、 -C オプションで複数列出力が要求されな い 限 り 、1 行に 1 エントリである。しかし、端末に対する出力では、出力が 1 列または複数列のどちらになるかが定められていない。オプション -1 と -C は、それぞれ 1 列出力と複数列出力を強制させるために使用される。 POSIX オプション -C ファイルを複数列でリスト表示する。垂直方向にソートする。 -F ディレクトリ名の後に ‘/’ を、FIFO の名前の後に ‘|’ を、実行可能 なファイル名の後に ‘*’ をそれぞれ付加する。 -R サブディレクトリがあれば、再帰的にリスト表示する。 -a ‘.’ で始まる名前のファイルをリスト表示に含める。 -c ソート (-t) やリスト表示 (-l) のとき、修正時刻ではなく状態変更時 刻を使う。 -d ディレクトリの中身を表示せず、他のファイルと同じようにディレクト リ名をリスト表示する。 -i ファイルのシリアル番号 (i-node 番号) をファイル名の出力の前に 置 く。 -l ファイルのモード・リンクの数・所有者名・グループ名・ (バイト単位 の) サイズ・タイムスタンプ・名前を (1 列形式で) 書き出す。デフォ ルトでは、表示されるタイムスタンプは最終修正時刻である。オプショ ン -c と -u のときは、他の 2 つのタイムスタンプを選択する。デ バ イススペシャルファイルの場合、通例として、サイズを表示する場所が デバイスのメジャー番号とマイナー番号に置き換えられる。 -q ファイル名の中の非表示文字をクエスチョンマークで出力する。 (端末 への出力では、このオプションをデフォルトにすることが許されている 。) -r ソートの順序を逆にする。 -t 表示されるタイムスタンプでソートする。 -u ソート (-t) やリスト表示 (-l) のとき、修正時刻ではなく最終アクセ ス時刻を使う。 -1 出力を 1 列にする。 GNU 詳細 標準出力が端末の場合、出力は (垂直方向にソートされて) 複数列になる。 dir (d という名前でもインストールされる) は ‘ls -C’ と等しい。つまり、 デフォルトとして、ファイルは垂直方向にソートされて複数列でリスト表示 さ れ る。 vdir (v という名前でもインストールされる) は ‘ls -l’ と等しい。 つまり、デフォルトとして、ファイルは長い形式でリスト表示される。 GNU オプション -1, --format=single-column 1 行に 1 ファイルをリスト表示する。標準出力が端末でない場合の デ フォルトである。 -a, --all ‘.’ ではじまるファイルを含め、ディレクトリ中のすべてのファイルを リスト表示する。 -b, --escape, --quoting-style=escape ファイル名の中の非表示文字を表すため、バックスラッシュとアルファ ベ ットのシーケンスやバックスラッシュと 8 進数のシーケンスを用い る。これらのシーケンスは C 言語で使われているものと同じである。 -c ディレクトリの内容をファイルの状態変更時刻 (inode の ‘ctime’) で ソ ートする。長いリスト表示形式が使われる (-l オプションの) 場合 、修正時刻ではなく状態変更時刻が表示される。 -d, --directory ディレクトリの中身を表示せず、他のファイルと同じようにディレクト リ名をリスト表示する。 -f ディレクトリの中身をソートせず、ディスク上にある順番にリスト表示 する。このオプションは -a も有効にする 。 -f よ り 前 に -l, --color, -s が指定された場合、それらのオプションは無効になる。 -g 無視される。Unix との互換性のためにある。 -h, --human-readable そ れぞれのサイズについて、例えばメガバイトなら M といったサイズ 文字を付加する。 10 の累乗ではなく 2 の累乗を用いるので 、M は 1,048,576 バイトを表す。 10 の累乗にしたいときは -H または --si オプションを使うこと。 -i, --inode それぞれのファイルについて、ファイル名の左に inode 番号 (ファ イ ルシリアル番号やインデックス番号とも呼ばれる) を表示する。 (この 番号が、あるファイルシステム上のそれぞれファイルを他と重ならない ように区別する。) -k, --kilobytes ファイルサイズがリスト表示される場合は、キロバイト単位で表示する 。 -l, --format=long, --format=verbose ファイル名に加えて、ファイルタイプ・アクセス権・ハードリンクの数 ・所有者名・グループ名・バイト単位のサイズ・タイムスタンプ (他の 時刻が選択されなければ、修正時刻) を表示する。ファイルの時刻が 6 カ 月以上前または 1 時間以上先の場合、タイムスタンプには時刻のか わりに年が入る。 リスト表示される各ディレクトリについて、ファイ ル 表 示 の 前 に ‘total blocks’ という行を置く。ここで、 blocks はディレクトリ内 の全てのファイルによって使用されるディスク容量の合計である。デフ ォルトでは 1024 バイトブロックが用いられるが、この値は上書きする ことができる。計算された blocks では、それぞれのハードリンクが別 個に数えられている。これはバグだという議論もある。 リスト表示されるアクセス権はシンボルモードの仕様と同じであるが、 ls は複数のビットを各アクセス権のセットの 3 文字目に組み入れてい る。 s setuid ビットまたは setgid ビットが設定されていて、さらに 対応する実行ビットが設定されている場合。 S setuid ビットまたは setgid ビットが設定されているが、対応 する実行ビットが設定されていない場合。 t sticky ビットとその他のユーザーに対する実行ビットがともに 設定されている場合。 T sticky ビットは設定されているが、その他のユーザーに対する 実行ビットが設定されていない場合。 x 実行ビットは設定されているが、上のどれも適用されていない 場合。 - その他。 -m, --format=commas ファイル名をコンマとスペースで区切って、それぞれの行にできるだけ 多く詰め込み、横にリスト表示する。 -n, --numeric-uid-gid 所有者のユーザ名・グループ名のかわりに数字の UID と GID をリスト 表示する。 -o 長い形式でのディレクトリのリスト表示をするが、グループ情報は表示 しない。 --format=long --no-group を用いるのと同じである。このオ プションは他のバージョンの ls との互換性のために提供された。 -p, --file-type, --indicator-style=file-type ファイルタイプを示す文字を各ファイル名に加える。 -F と似ているが 、実行可能ファイルにはマークしない。 -q, --hide-control-chars ファイル名の中の非表示文字の代わりにクエスチョンマークを表示する 。出力が端末、プログラムが ls の場合のデフォルトである。 -r, --reverse ディレクトリの中身を逆順にソートする。 -s, --size それぞれのファイルのディスク割り当て量をファイル名の左に表示する 。これはファイルによって使用されるディスクの総量である。この大き さは普通はファイルのサイズよりいくらか大きいが、ファイルがホール (穴) を持っている場合は小さくなることもある。 各ファイルの割り当て量は 1024 バイトブロック単位でファイル名の左 に表示される。しかし、このブロックサイズは上書きされるかもしれな い。 -t, --sort=time アルファベット順ではなく修正時刻 (inode の ‘mtime’) でソートする 。最も新しいファイルが最初にくる。 -u 修正時刻ではなく最終アクセス時刻 (inode の ‘atime’) でディレクト リの中身をソートする。長いリスト表示形式が使われる場合、修正時刻 ではなく最終アクセス時刻が表示される。 -v, --sort=version バージョン名とバージョン番号でソートする。バージョンの一番低いも の が最初にくる。デフォルトのソートのように動作するが、10 進の数 字のシーケンスは、インデックス番号またはバージョン番号として数値 的に扱われる。ゼロを前にもつ数値部分は小数として扱われる。 ls -1 ls -1v bar-1.gz bar-1.gz bar-100.gz bar-2.gz bar-12.gz bar-12.gz bar-2.gz bar-100.gz foo-1.007.gz foo-1.007.gz foo-1.012b.gz foo-1.01a.gz foo-1.01a.gz foo-1.012b.gz -w, --width cols スクリーンの幅を cols 文字と仮定する。可能ならばターミナルドライ バからデフォルトの値を採用する。それが不可能な場合には、環境変数 COLUMNS が設定されていればその値を使う。設定されていない場合のデ フォルトは 80 文字である。 -x, --format=across, --format=horizontal ファイルを複数列でリスト表示する。水平方向にソートする。 -A, --almost-all ディレクトリ内の ‘.’ と ‘..’ 以外のすべてのファイルをリスト表 示 する。 -B, --ignore-backups コマンドラインで指定した場合を除いて、‘~’ で終わるファイルをリス ト表示しない。 -C, --format=vertical ファイルを複数列でリスト表示する。垂直方向にソートする。標準出力 が端末のときのデフォルトである。 dir と d ではこのオプションが常 にデフォルトになっている。最も少ない行でなるべく多くのファイルを 表示するため GNU ls は可変幅の列を使う。 -D, --dired 長いリスト表示 (-l) と一緒に使われた場合、メインの出力の後に以下 のような追加の行を表示する: //DIRED// BEG1 END1 BEG2 END2 ... BEGn と ENDn は符号なし整数で、リスト出力における各ファイル名 の 始めと終わりのバイト位置を記録したものである。このオプションを使 うと、ファイル名にスペースや改行といった普段使わない文字が含まれ て い る 場合でも、 Emacs でファイル名を探すのが (ファンシー検索 (fancy searching) を使わなくても) 簡単になる。 ディレクトリが再帰的にリスト表示される (-R オプションの) 場合 、 各サブディレクトリの後に以下ような行を出力する: //SUBDIRED// BEG1 END1 ... 最後に、以下のような行を出力する。 //DIRED-OPTIONS// --quoting-style=WORD ここで WORD はクォートのスタイルである。 -F, --classify --indicator-style=classify と同じ。 -G, --no-group 長い形式でのディレクトリのリスト表示の場合に、グループ情報の表示 をさせない。 -H, --si それぞれのサイズについて、例えばメガバイトなら M といったサイ ズ 文字を付加する (SIとは国際単位系のことで、これらの文字を接頭辞と 定義している)。 2 の累乗ではなく 10 の累乗を用いるので、 M は 1,000,000 バ イ ト を 表 す。 2 の累乗にしたいときは -h または --human-readable オプションを使うこと。 -I, --ignore=pattern コマンドラインで与えられない限り、シェルパターン pattern (注:正 規表現とは異なる) にマッチする名前のファイルはリスト表示しない。 シェルと同様に、ファイル名の先頭にある ‘.’ は pattern の始めにあ るワイルドカードにはマッチしない。たとえば、 lightside:~% ls --ignore=’.??*’ --ignore=’.[^.]’ \ --ignore=’#*’ で は、 1 つ目のオプションが ‘.’ で始まる 3 文字以上の長さの名前 をリストから除外する。また、2 つ目のオプションが ‘..’ 以外の ‘.’ で 始 ま る 2 文字の名前を除外する。さらに、3 つ目のオプションが ‘#’ で始まる名前をリストから除外する。 -L, --dereference シンボリックリンクそのものではなく、参照しているファイルの情報を リスト表示する。 -N, --literal ファイル名中の非表示文字の変換を行わない。 -Q, --quote-name, --quoting-style=c フ ァイル名をダブルクォートで囲む。さらに、非表示文字を C 言語で 使われている形式に変換して表示する。 -R, --recursive すべてのディレクトリの中身を再帰的にリスト表示する。 -S, --sort=size アルファベット順でなく、ファイルサイズでディレクトリの中身をソー トする。最も大きいファイルが最初に表示される。 -T, --tabsize cols タ ブストップの幅を cols 文字分と仮定する。デフォルトは 8 文字分 。 ls は効率をよくするために出力中の可能な場所でタブ を 使 う 。 cols がゼロの場合、タブをまったく使わない。 -U, --sort=none ディレクトリの中身をソートせず、ディスク上にある順番にリスト表示 する (-U と -f の違いは、-f オプションが他のオプションを有効にし た り無効にしたりする点にある)。非常に大きなディレクトリをリスト 表示する場合、このオプションは特に有用である。なぜなら、ソートを しないことにより著しく速くできるからである。 -X, --sort=extension デ ィレクトリの中身をファイル拡張子 (最後の ‘.’ の後につづく文字 列) のアルファベット順にソートする。拡張子のないファイルは最初に ソートされる。 --block-size=SIZE 環境変数の値を上書きして、ブロックサイズを SIZE に設定する。 --color[=when] ファイルタイプを区別するための色づけの有無を指定する。色は環境変 数 LS_COLORS を用いて指定される。この変数の設定法についての情 報 は dircolors(1) を参照すること。 when は省略できる。以下のいずれ か 1 つを指定することもできる: none まったく色づけしない。これがデフォルトである。 auto 標準出力が端末の場合のみ色づけする。 always 常に色づけする。 --color を指定して when に何にも指定しな いのは --color=always と等しい。 --full-time 時刻に関する情報を標準の省略形式ではなく完全な形式でリスト表示す る。時刻の表示形式は date(1) のデフォルトと同じ。この形式は変 更 で き ないが、時刻の文字列を cut(1) で取り出し、結果を ‘date -d’ に渡すことができる。 時刻の出力に秒単位の情報を含んでいるので、このオプションはとても 有 用である。 (Unix ファイルシステムは、四捨五入した秒単位までの タイムスタンプしか持たないので、このオプションはタイムスタンプに あ るすべての情報を表示する。) 例えば、Makefile でファイルを正し く再生成してくれない場合にこのオプションが役立つ。 --indicator-style=WORD 各ファイル名にファイルタイプを示す文字を付加する。付加される文字 は WORD に依存する: none ファイルタイプを示す文字を付加しない。これがデフォルトの 動作である。 file-type ディレクトリに ‘/’ を、シンボリックリンクに ‘@’ を、 FIFO に ‘|’ を、ソケットに ‘=’ を付加する。通常のファイルには 何もつけない。 -p と --file-type に等しい。 classify file-type と同じであるが、さらに実行可能ファイルには ‘*’ をつける。 -F と --classify に等しい。 --quoting-style=WORD 出力されるファイル名をクォートするために、 WORD で指示されるスタ イルを使用する。 WORD は次のいずれかでなければならない: literal ファイル名をそのまま出力する。これがデフォルトの動作で あ るが、将来のバージョンでは shell がデフォルトになるかもし れない。 shell ファイル名がシェルのメタキャラクタを含む場合や、シェル に よ くわからない出力を引き起こさせるかもしれない場合には、 ファイル名をクォートする。 shell-always 通常はクォートを必要としないファイル名に対しても、クォ ー トを行う。 c C 言語における文字列の形式でファイル名をクォートする。 -Q と --quote-name に等しい。 escape c と同じであるが、ファイル名を囲むダブルクォート文字を 省 略する。 -b と --escape に等しい。 locale c 形式と似ているが、 "このように" 適切なロケール固有のク ォートシンボルを使う。 clocale c 形式と似ているが、 ‘このように’ 適切なロケール固有の ク ォートシンボルを使う。 --quoting-style オ プ シ ョ ンのデフォルトの値は環境変数 QUOT- ING_STYLE で指定することができる。 --show-control-chars ファイル名の中の非表示文字をそのまま出力する。出力が端末でないか 、プログラムが ls でない場合はデフォルトである。 --time=atime, --time=access --sort=time または -t と一緒に使われると、 -u (atime でソートす る) と等しくなる。普通に時刻を表示するオプションと一緒に使われる と、各ファイルの最終修正時刻ではなく最終アクセス時刻を表示する。 --time=ctime, --time=status, --time=use --sort=time または -t と一緒に使われると、 -c (ctime でソート す る) と等しくなる。普通に時刻を表示するオプションと一緒に使われる と、各ファイルの最終修正時刻ではなく inode の最終変更時刻を表 示 する。 GNU 標準オプション --help 標準出力に使用方法のメッセージを出力して正常終了する。 --version 標準出力にバージョン情報を出力して正常終了する。 -- オプションリストの終りを示す。 ブロックサイズ デ フ ォルトの出力ファイルブロックサイズは 1024 バイト (POSIXLY_CORRECT が設定されているときは 512 バイト) である。この値は以下の環境変数のどれ か を 設 定 す る こ と で 変 更 で き る。また、これらの環境変数の値は --block-size=SIZE がオプションに与えられると無視される。 優先順位: LS_BLOCK_SIZE, BLOCK_SIZE, POSIXLY_CORRECT. これらの変数の値は、数字でも human-readable でも si でもよい。数字の 後 には、何倍であるかを指定するサイズ文字と、通常のバイトを選択する B また は 10 進の「商業用」バイトを選択する D を続けて も よ い 。 た と え ば 、‘BLOCK_SIZE=1KB’ は ‘BLOCK_SIZE=1024’ に等しく、 ‘BLOCK_SIZE=1KD’ は ‘BLOCK_SIZE=1000’ に等しい。 以下の文字が認識される (また --human-readable と --si オプションで表 示 されるときに用いられる) k キロ: --human-readable なら 2^10 = 1024、 --si なら 10^3 = 1000 M メガ: 2^20 = 1,048,576 または 10^6 = 1,000,000 G ギガ: 2^30 = 1,073,741,824 または 10^9 = 1,000,000,000 T テラ: 2^40 = 1,099,511,627,776 または 10^12 = 1,000,000,000,000 P ペ タ: 2^50 = 1,125,899,906,842,624 ま た は 10^15 = 1,000,000,000,000,000 E エクサ: 2^60 = 1,152,921,504,606,846,976 ま た は 10^18 = 1,000,000,000,000,000,000 Z ゼ タ: 2^70 = 1,180,591,620,717,411,303,424 または 10^21 = 1,000,000,000,000,000,000,000 Y ヨタ: 2^80 = 1,208,925,819,614,629,174,706,176 また は 10^24 = 1,000,000,000,000,000,000,000,000 環境変数 変 数 LS_BLOCK_SIZE, BLOCK_SIZE, POSIXLY_CORRECT は出力ファイルブロック サイズの選択を決定する。変数 COLUMNS は (10 進の整数表現を含んでいる 場 合) 、 (-C オプションで使われる) 出力の列の幅を決定する。ファイル名は複 数列での出力にあわせるために短くされたりはしない。変数 QUOTING_STYLE は 出力のクォートのスタイルを決定する。変数 LS_COLORS は使用される色を指定 するために使われる。変数 LANG, LC_ALL, LC_COLLATE, LC_CTYPE, LC_MES- SAGES, LC_TIME が通常の意味を持つ。変数 TZ は ls によって書き出される時 刻の文字列のためのタイムゾーンを与える。 バグ BSD システムでは、HP-UX システムから NFS マウントしたファイルに対して、 -s オプションでは正しい値の半分の値を表示してしまう。 HP-UX システムで は、BSD システムから NFS マウントしたファイルに対して、 ls は正しい値の 2 倍の値を表示してしまう。これは HP-UX の欠陥によるもので、HP-UX の ls プログラムにも影響を及ぼしている。 準拠 POSIX 1003.2 関連項目 dircolors(1) 注意 このページは fileutils-4.1 パッケージの ls コマンドについて説明したもの で ある; その他のバージョンでは少し違いがあるかもしれない。修正や追加は aeb@cwi.nl, aw@mail1.bet1.puv.fi, ragnar@ragnar-hojland.com 宛にメー ル で連絡してください。プログラムのバグについては bug-fileutils@gnu.org へ 報告してください。 GNU fileutils 4.1 18 June 2002 LS(1)
LS(1) User Commands LS(1)
NAME
ls - list directory contents
SYNOPSIS
ls [OPTION]... [FILE]...
DESCRIPTION
List information about the FILEs (the current directory by default).
Sort entries alphabetically if none of -cftuvSUX nor --sort.
Mandatory arguments to long options are mandatory for short options
too.
-a, --all
do not ignore entries starting with .
-A, --almost-all
do not list implied . and ..
--author
with -l, print the author of each file
-b, --escape
print octal escapes for nongraphic characters
--block-size=SIZE
use SIZE-byte blocks. See SIZE format below
-B, --ignore-backups
do not list implied entries ending with ~
-c with -lt: sort by, and show, ctime (time of last modification of
file status information) with -l: show ctime and sort by name
otherwise: sort by ctime
-C list entries by columns
--color[=WHEN]
colorize the output. WHEN defaults to ‘always’ or can be
‘never’ or ‘auto’. More info below
-d, --directory
list directory entries instead of contents, and do not derefer-
ence symbolic links
-D, --dired
generate output designed for Emacs’ dired mode
-f do not sort, enable -aU, disable -ls --color
-F, --classify
append indicator (one of */=>@|) to entries
--file-type
likewise, except do not append ‘*’
--format=WORD
across -x, commas -m, horizontal -x, long -l, single-column -1,
verbose -l, vertical -C
--full-time
like -l --time-style=full-iso
-g like -l, but do not list owner
--group-directories-first
group directories before files.
augment with a --sort option, but any use of --sort=none (-U)
disables grouping
-G, --no-group
in a long listing, don’t print group names
-h, --human-readable
with -l, print sizes in human readable format (e.g., 1K 234M 2G)
--si likewise, but use powers of 1000 not 1024
-H, --dereference-command-line
follow symbolic links listed on the command line
--dereference-command-line-symlink-to-dir
follow each command line symbolic link that points to a direc-
tory
--hide=PATTERN
do not list implied entries matching shell PATTERN (overridden
by -a or -A)
--indicator-style=WORD
append indicator with style WORD to entry names: none (default),
slash (-p), file-type (--file-type), classify (-F)
-i, --inode
print the index number of each file
-I, --ignore=PATTERN
do not list implied entries matching shell PATTERN
-k like --block-size=1K
-l use a long listing format
-L, --dereference
when showing file information for a symbolic link, show informa-
tion for the file the link references rather than for the link
itself
-m fill width with a comma separated list of entries
-n, --numeric-uid-gid
like -l, but list numeric user and group IDs
-N, --literal
print raw entry names (don’t treat e.g. control characters spe-
cially)
-o like -l, but do not list group information
-p, --indicator-style=slash
append / indicator to directories
-q, --hide-control-chars
print ? instead of non graphic characters
--show-control-chars
show non graphic characters as-is (default unless program is
‘ls’ and output is a terminal)
-Q, --quote-name
enclose entry names in double quotes
--quoting-style=WORD
use quoting style WORD for entry names: literal, locale, shell,
shell-always, c, escape
-r, --reverse
reverse order while sorting
-R, --recursive
list subdirectories recursively
-s, --size
print the allocated size of each file, in blocks
-S sort by file size
--sort=WORD
sort by WORD instead of name: none -U, extension -X, size -S,
time -t, version -v
--time=WORD
with -l, show time as WORD instead of modification time: atime
-u, access -u, use -u, ctime -c, or status -c; use specified
time as sort key if --sort=time
--time-style=STYLE
with -l, show times using style STYLE: full-iso, long-iso, iso,
locale, +FORMAT. FORMAT is interpreted like ‘date’; if FORMAT
is FORMAT1
Copyright(C) linux-cmd.com All Rights Reserved. Author Takayuki Yukawa