I've been trying to find the difference between using the dir
and ls
commands in terminal. I know ls
is the traditional UNIX method of viewing the files in a directory, and that dir
is the windows command prompt equivalent, but both commands work in terminal.
If I type in dir
, it displays the files and folders in the directory, and if I type ls
, it does the same, except with content highlighting. Both commands accept options (i.e. ls -a
and dir -a
both return all files and folders and hidden files.
So does anyone know what the difference is and why both dir
and ls
are used?