asked 188k views
0 votes
Which commands will give you information about how much disk space each file in the current directory uses?

1) ls -l
2) ls -la
3) du

asked
User Cory Dee
by
8.5k points

1 Answer

1 vote

Final answer:

Use the 'du' command to see disk space used by each file in a directory. The 'ls -l' and 'ls -la' commands show file sizes but do not provide comprehensive disk usage like 'du'.

Step-by-step explanation:

To find out how much disk space each file in the current directory uses, the command you would use is du, which stands for disk usage. The ls command, with the -l (long format) option, will give you details about the files, such as permissions, number of links, owner, group, file size, and the last modified time. Using ls with the -la option will display all files, including hidden ones, with the same detailed format. While both ls -l and ls -la do show file sizes, they do not sum the sizes of files in directories or provide as comprehensive information about disk space usage as du.

answered
User Stefan Rein
by
8.2k points