1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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

Discussion in 'TCC/LE Support' started by jason404, Jun 11, 2011.

  1. jason404

    Joined:
    Mar 21, 2011
    Messages:
    30
    Likes Received:
    0
    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. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,523
    Likes Received:
    4
    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. Jim Cook

    Joined:
    May 20, 2008
    Messages:
    605
    Likes Received:
    0
    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:




    --
    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.
     
  4. jason404

    Joined:
    Mar 21, 2011
    Messages:
    30
    Likes Received:
    0
    Thanks to both of you. I had read that page in the help, but evidently not closely enough.
     

Share This Page