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

Clash 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.
shell-script shell ls touch
marked as duplicate by Jeff Schaller, Archemar, schily, Jesse_b, slmâ¦
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.
add a comment |Â
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.
shell-script shell ls touch
marked as duplicate by Jeff Schaller, Archemar, schily, Jesse_b, slmâ¦
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.
add a comment |Â
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.
shell-script shell ls touch
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
shell-script shell ls touch
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â¦
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â¦
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.
add a comment |Â
add a comment |Â
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.
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 GNUlsand its--block-sizeoption ;-).
â Stephen Kitt
Jul 20 at 11:38
add a comment |Â
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.
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 GNUlsand its--block-sizeoption ;-).
â Stephen Kitt
Jul 20 at 11:38
add a comment |Â
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.
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 GNUlsand its--block-sizeoption ;-).
â Stephen Kitt
Jul 20 at 11:38
add a comment |Â
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.
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.
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 GNUlsand its--block-sizeoption ;-).
â Stephen Kitt
Jul 20 at 11:38
add a comment |Â
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 GNUlsand its--block-sizeoption ;-).
â 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
add a comment |Â