How Can i control the 'total' output in 'ls -l' command? [duplicate]

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;







up vote
1
down vote

favorite













This question already has an answer here:



  • what is total in the output of ls command [duplicate]

    3 answers



the question is, how can control the ls -l total output ?
first impression with example that give us 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


As i mention this example give us this result total = 0 by creating empty file.



in other way I will try to create a non empty file2 contain '3ls3' .



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


this second example give us total 4 by creating a non empty file.
the hole Q is how can i get for e.g total 1 or total 2 etc.. by creating a new file.







share|improve this question













marked as duplicate by Jeff Schaller, Archemar, schily, Jesse_b, slm♦ shell
Users with the  shell badge can single-handedly close shell questions as duplicates and reopen them as needed.

StackExchange.ready(function()
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();

);
);
);
Jul 20 at 15:21


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.




















    up vote
    1
    down vote

    favorite













    This question already has an answer here:



    • what is total in the output of ls command [duplicate]

      3 answers



    the question is, how can control the ls -l total output ?
    first impression with example that give us 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


    As i mention this example give us this result total = 0 by creating empty file.



    in other way I will try to create a non empty file2 contain '3ls3' .



    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


    this second example give us total 4 by creating a non empty file.
    the hole Q is how can i get for e.g total 1 or total 2 etc.. by creating a new file.







    share|improve this question













    marked as duplicate by Jeff Schaller, Archemar, schily, Jesse_b, slm♦ shell
    Users with the  shell badge can single-handedly close shell questions as duplicates and reopen them as needed.

    StackExchange.ready(function()
    if (StackExchange.options.isMobile) return;

    $('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
    var $hover = $(this).addClass('hover-bound'),
    $msg = $hover.siblings('.dupe-hammer-message');

    $hover.hover(
    function()
    $hover.showInfoMessage('',
    messageElement: $msg.clone().show(),
    transient: false,
    position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
    dismissable: false,
    relativeToBody: true
    );
    ,
    function()
    StackExchange.helpers.removeMessages();

    );
    );
    );
    Jul 20 at 15:21


    This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
















      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite












      This question already has an answer here:



      • what is total in the output of ls command [duplicate]

        3 answers



      the question is, how can control the ls -l total output ?
      first impression with example that give us 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


      As i mention this example give us this result total = 0 by creating empty file.



      in other way I will try to create a non empty file2 contain '3ls3' .



      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


      this second example give us total 4 by creating a non empty file.
      the hole Q is how can i get for e.g total 1 or total 2 etc.. by creating a new file.







      share|improve this question














      This question already has an answer here:



      • what is total in the output of ls command [duplicate]

        3 answers



      the question is, how can control the ls -l total output ?
      first impression with example that give us 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


      As i mention this example give us this result total = 0 by creating empty file.



      in other way I will try to create a non empty file2 contain '3ls3' .



      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


      this second example give us total 4 by creating a non empty file.
      the hole Q is how can i get for e.g total 1 or total 2 etc.. by creating a new file.





      This question already has an answer here:



      • what is total in the output of ls command [duplicate]

        3 answers









      share|improve this question












      share|improve this question




      share|improve this question








      edited Jul 20 at 12:08









      Jeff Schaller

      30.8k846104




      30.8k846104









      asked Jul 20 at 11:24









      3ls3

      62




      62




      marked as duplicate by Jeff Schaller, Archemar, schily, Jesse_b, slm♦ shell
      Users with the  shell badge can single-handedly close shell questions as duplicates and reopen them as needed.

      StackExchange.ready(function()
      if (StackExchange.options.isMobile) return;

      $('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
      var $hover = $(this).addClass('hover-bound'),
      $msg = $hover.siblings('.dupe-hammer-message');

      $hover.hover(
      function()
      $hover.showInfoMessage('',
      messageElement: $msg.clone().show(),
      transient: false,
      position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
      dismissable: false,
      relativeToBody: true
      );
      ,
      function()
      StackExchange.helpers.removeMessages();

      );
      );
      );
      Jul 20 at 15:21


      This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.






      marked as duplicate by Jeff Schaller, Archemar, schily, Jesse_b, slm♦ shell
      Users with the  shell badge can single-handedly close shell questions as duplicates and reopen them as needed.

      StackExchange.ready(function()
      if (StackExchange.options.isMobile) return;

      $('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
      var $hover = $(this).addClass('hover-bound'),
      $msg = $hover.siblings('.dupe-hammer-message');

      $hover.hover(
      function()
      $hover.showInfoMessage('',
      messageElement: $msg.clone().show(),
      transient: false,
      position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
      dismissable: false,
      relativeToBody: true
      );
      ,
      function()
      StackExchange.helpers.removeMessages();

      );
      );
      );
      Jul 20 at 15:21


      This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.






















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          2
          down vote













          From 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.


          The minimum number of blocks allocated to a file depends on OS, file system type etc, so there is no direct way to influence the number shown.






          share|improve this answer





















          • This doesn’t change your point, but the block size varies from one operating system to another, it’s not always 512 bytes.
            – Stephen Kitt
            Jul 20 at 11:32










          • @StephenKitt True, one more parameter which can't easily be influenced by the user :-)
            – nohillside
            Jul 20 at 11:33






          • 2




            ... except with GNU ls and its --block-size option ;-).
            – Stephen Kitt
            Jul 20 at 11:38

















          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          2
          down vote













          From 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.


          The minimum number of blocks allocated to a file depends on OS, file system type etc, so there is no direct way to influence the number shown.






          share|improve this answer





















          • This doesn’t change your point, but the block size varies from one operating system to another, it’s not always 512 bytes.
            – Stephen Kitt
            Jul 20 at 11:32










          • @StephenKitt True, one more parameter which can't easily be influenced by the user :-)
            – nohillside
            Jul 20 at 11:33






          • 2




            ... except with GNU ls and its --block-size option ;-).
            – Stephen Kitt
            Jul 20 at 11:38














          up vote
          2
          down vote













          From 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.


          The minimum number of blocks allocated to a file depends on OS, file system type etc, so there is no direct way to influence the number shown.






          share|improve this answer





















          • This doesn’t change your point, but the block size varies from one operating system to another, it’s not always 512 bytes.
            – Stephen Kitt
            Jul 20 at 11:32










          • @StephenKitt True, one more parameter which can't easily be influenced by the user :-)
            – nohillside
            Jul 20 at 11:33






          • 2




            ... except with GNU ls and its --block-size option ;-).
            – Stephen Kitt
            Jul 20 at 11:38












          up vote
          2
          down vote










          up vote
          2
          down vote









          From 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.


          The minimum number of blocks allocated to a file depends on OS, file system type etc, so there is no direct way to influence the number shown.






          share|improve this answer













          From 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.


          The minimum number of blocks allocated to a file depends on OS, file system type etc, so there is no direct way to influence the number shown.







          share|improve this answer













          share|improve this answer



          share|improve this answer











          answered Jul 20 at 11:29









          nohillside

          1,846616




          1,846616











          • This doesn’t change your point, but the block size varies from one operating system to another, it’s not always 512 bytes.
            – Stephen Kitt
            Jul 20 at 11:32










          • @StephenKitt True, one more parameter which can't easily be influenced by the user :-)
            – nohillside
            Jul 20 at 11:33






          • 2




            ... except with GNU ls and its --block-size option ;-).
            – Stephen Kitt
            Jul 20 at 11:38
















          • This doesn’t change your point, but the block size varies from one operating system to another, it’s not always 512 bytes.
            – Stephen Kitt
            Jul 20 at 11:32










          • @StephenKitt True, one more parameter which can't easily be influenced by the user :-)
            – nohillside
            Jul 20 at 11:33






          • 2




            ... except with GNU ls and its --block-size option ;-).
            – Stephen Kitt
            Jul 20 at 11:38















          This doesn’t change your point, but the block size varies from one operating system to another, it’s not always 512 bytes.
          – Stephen Kitt
          Jul 20 at 11:32




          This doesn’t change your point, but the block size varies from one operating system to another, it’s not always 512 bytes.
          – Stephen Kitt
          Jul 20 at 11:32












          @StephenKitt True, one more parameter which can't easily be influenced by the user :-)
          – nohillside
          Jul 20 at 11:33




          @StephenKitt True, one more parameter which can't easily be influenced by the user :-)
          – nohillside
          Jul 20 at 11:33




          2




          2




          ... except with GNU ls and its --block-size option ;-).
          – Stephen Kitt
          Jul 20 at 11:38




          ... except with GNU ls and its --block-size option ;-).
          – Stephen Kitt
          Jul 20 at 11:38


          Popular posts from this blog

          Peggy Mitchell

          Palaiologos

          The Forum (Inglewood, California)