Sobes.tech
Junior — Middle

Do the du and df commands have the ability to display results in a human-readable format?

sobes.tech AI

Answer from AI

Yes, the du and df commands have the ability to display results in a human-readable format using the -h option. This option outputs sizes in kilobytes (K), megabytes (M), gigabytes (G), etc., making the information easier to understand.

Examples:

du -h /path/to/directory
# Shows the size of the directory in a human-readable format

df -h
# Shows disk space usage with human-readable units