M HYPE SPLASH
// general

Why ls -l total is 0 even even there are files in the directory?

By John Peck

I have a directory, inside that, I have created 2 files and have written some content in these files when I run ls -l. It still displays the total as 0. Why? It should return some positive integer.

I already referred to this answer, and I am convinced with the explanation. But why total 0, I still didn't understand.

I am running this command in ubuntu (20.04 LTS) using Windows Subsystem for Linux on Windows 10.

ls output

4

1 Answer

I suppose that's because you're using WSL on a NTFS volume. NTFS will store small files directly in file's record inside MFT (Master File Table). For larger files this space in a file record would be reserved, but not used. So a small file is essentially taking no extra space on disk, except for what the file record would take anyway, therefore producing a total of 0.

2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy