Difference between LS and du command

Collapse

Unconfigured Ad Widget

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • wisly.k
    Member
    • May 2022
    • 99

    Difference between LS and du command

    Hi,
    What is the difference between LS and du command?
  • Christian J
    Member
    • Sep 2022
    • 91

    #2
    Hi,

    The LS and DU commands are used in Unix/Linux systems for different purposes.

    An LS command lists the contents of a directory. It displays the names of all files and directories within the current directory or specified directory. With the LS command, additional information about files and directories, including permissions, file size, and creation time, can be displayed.

    On the other hand, the DU command is used to estimate the disk usage of files and directories. With the DU command, you can display disk usage in various formats, including kilobytes, megabytes, and gigabytes. It displays how much space is used by a directory or file and its subdirectories.

    In summary, the main difference between the LS and DU commands is that the LS command lists the contents of a directory, whereas the DU command estimates the disk usage of files and directories.


    Comment

    Working...
    X