Is there a command equivalent to ls -a in bash?

  • This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
Mar 21, 2011
30
0
#1
Is there a dir switch combination which shows all files and directories, like ls -a in bash?

dir /a:h /a:d will show both hidden and non-hidden directories at the same time, but I cannot find a way to make it show files as well.

I found pdir, but I am not getting very far with it.
 
#2
From: jason404
| Is there a
| Code:
| dirswitch combination which shows all files and directories, like
| Code:
| ls -ain bash?
|
|
| Code:
| dir /a:h /a:dwill show both hidden and non-hidden directories at the
| same time, but I cannot find a way to make it show files as well.

1/ Only the last occurrence of the /a: option in the command is effective. All attribute selection options must be combined in that one occurrence. Your example worked as reported because the /A:D option (without additional suboptions) selects ALL directories, including hidden ones.

2/ Option /A: selects all directories and all files unconditionally. As the HELP reports, the choices made after the /A: restrict selection to whatever is explicitly specified. Please read HELP topic "Attribute Switches".
--
HTH, Steve
 
#3
How about just dir /a with no extra parameters? Does that do what you want?

On Sat, Jun 11, 2011 at 08:40, jason404 <> wrote:


> Is there a
> Code:
> ---------
> dir
> ---------
> switch combination which shows all files and directories, like
> Code:
> ---------
> ls -a
> ---------
> in bash?
>
>
> Code:
> ---------
> dir /a:h /a:d
> ---------
> will show both hidden and non-hidden directories at the same time, but I
> cannot find a way to make it show files as well.
>
>
>
>
>


--
Jim Cook
2011 Monday: 4/4, 6/6, 8/8, 10/10, 12/12 and 5/9, 9/5, 7/11, 11/7.
Next year they're Tuesday.