I am executing the ls command to show the contents of a folder,
it shows some number in front of word total as highlighted in blue color below quotes.
Can anyone please share that what it is?
It tells you the number of hard links. Here is a nice blog article which describes a bit more in depth:
http://www.giannistsakiris.com/index.php/2011/04/15/counting-and-listing-hard-links-on-linux/
Use ls -ls to see how many blocks each file uses (listed at the beginning of the line):
efs:/home2/myid/z/blocktest $ ls -ls
total 6
2 -rw-rw---- 1 myid mygroup 52 May 3 08:53 file.dat
4 -rw-rw---- 1 myid mygroup 1820 May 3 08:54 file2.dat
efs:/home2/myid/z/blocktest $
From the man page:
-s, --size
with -l, print size of each file, in blocks
P.S. The link count is actually the 3rd field from the left on the long listing above. Consider this listing where I made a hard link (see the man page for the ln command) to file2.dat and used the -i option to ls to show the inode number (the inode points to the actual file on disk) which shows both files point to the same inode. Usually a link would point to a file in another directory, but for the sake of the experiment I made it in the same dir. An edit made to link_2_file2.dat will also show in file2.dat as both filenames (inodes) point to the same location on disk.
efs:/home2/myid /z/blocktest $ ls -lsi
total 10
16488 2 -rw-rw---- 1 myid mygroup 52 May 3 08:53 file.dat
16489 4 -rw-rw---- 2 myid mygroup 1820 May 3 09:02 file2.dat
16489 4 -rw-rw---- 2 myid mygroup 1820 May 3 09:02 link_2_file2.dat
efs:/home2/myid /z/blocktest $
It's interesting that the blocks used for file2.dat and the hard link to it are the same and are both added to the total count even though they both point to the same place. This does not happen for a symbolic link (which uses its own inode and is thus a different file) but still points to the same file, but then that's another topic altogether. See the man pages and give it a try!
efs:/home2/myid/z/blocktest $ ls -lsi
total 10
16488 2 -rw-rw---- 1 myid mygroup 52 May 3 08:53 file.dat
16489 4 -rw-rw---- 2 myid mygroup 1820 May 3 09:02 file2.dat
16489 4 -rw-rw---- 2 myid mygroup 1820 May 3 09:02 link_2_file2.dat
16490 0 lrwxrwxrwx 1 myid mygroup 9 May 3 09:24 sym_link_2_file2.dat -> file2.dat
efs:/home2/myid/z/blocktest $