Difference between "dir" and "ls" Commands (with an Example)
linuxtldr.comยท1d
Flag this post

๐Ÿš€

Quick Overview

The two commands are identical, and you can consider that โ€œdirโ€ is equivalent to the โ€œls -Cbโ€ command.

In the Linux world, two common commands, โ€œlsโ€ and โ€œdirโ€œ, replicate each other so well that most Linux users think one of them is an alias or symbolic link to the other (itโ€™s not true).

Another mistake most people make is judging the output of ls (which by default displays the color) and dir (which does not without specifying an option) and again failing to judge it because โ€œlsโ€ is an alias to โ€œls --color=autoโ€œ.

To verify this, execute the โ€œalias lsโ€ command, or check the result after executiโ€ฆ

Similar Posts

Loading similar posts...