「ls -l」コマンドの「フル」出力をどのように制御しますか? [コピー]

「ls -l」コマンドの「フル」出力をどのように制御しますか? [コピー]

問題は出力をどのように制御するかですls -l total。私たちへの第一印象total = 0

els3@els3PC:~/test$ touch file
els3@els3PC:~/test$ ls -l
total 0
-rw-r--r-- 1 els3 els3 0 Jul 20 12:05 file

total = 0前述のように、この例では空のファイルを生成してこれらの結果を提供します。

それ以外の場合は、「3ls3」を含む空でないfile2を作成しようとします。

els3@els3PC:~/test$ cat > file2
3ls3
^C
els3@els3PC:~/test$ cat file2
3ls3
els3@els3PC:~/test$ ls -l
total 4
-rw-r--r-- 1 els3 els3 5 Jul 20 12:11 file2

2番目の例total 4では、空でないファイルを作成してそれを提供します。問題は、新しいファイルを作成して背中をtotal 1取得する方法です。total 2

ベストアンサー1

からman ls

In addition, for each directory whose contents are displayed, the total number of 
512-byte  blocks used by the files in the directory is displayed on a line by 
itself, immediately before the information for the files in the directory.

ファイルに割り当てられる最小ブロック数は、オペレーティングシステム、ファイルシステムの種類などによって異なり、表示された数に直接影響を与える方法はありません。

おすすめ記事