What is the DOS-counterpart of the bash command
ls -lad on Unix?
The "dir" command on Command Prompt (cmd.exe) on Windows is usually considered to be equivalent to the "ls" command of bash on Unix/Linux. However, "dir" lacks the feature of the "-d" option of "ls". The "-d" option treats directories like plain files, and prevents their child files and subdirectories from being displayed.
ls -lad ITEM
- Basically, what I need is the existence and type of the given ITEM.
- As for type, I need to know whether it is a directory, a regular file or a link.
- If it is a directory, I do not want its child files nor subdirectories to be displayed.
- If it is a link, I need to know the target.
Is there any DOS command (or even PowerShell command) with these features (1) through (4)?
dir ITEM /a attrib ITEM
The "attrib" command on DOS also tells the existence of the given ITEM; and, if it is a directory, "attrib" refrains from displaying its child files and subdirectories. However, "attrib" fails to tell whether it is a directory, a regular file or a link.