Results 1 to 9 of 9

Thread: command problem

  1. #1
    Join Date
    Dec 2011
    Beans
    46

    command problem

    Sir,
    I don't see any difference between ls and ls -A.

    The output of both the commands are same.

    If there is any difference what is that?

    I didn't understand the man page of ls -A

    What is ls -A ?

  2. #2
    Join Date
    Jan 2010
    Location
    Auckland, New Zealand
    Beans
    87
    Distro
    Ubuntu 12.10 Quantal Quetzal

    Re: command problem

    Hi

    The "ls" command by default ignores files where the name starts with a period (.) and they don't appear in the listing. The "-a" option lists all files, including those with filenames starting with a period. This includes the filenames for the current directory (.) and the parent directory (..). The "-A" option lists almost all the files by omitting the (.) and (..) entries.

    Hope that helps.

  3. #3
    Join Date
    Dec 2011
    Beans
    46

    Re: command problem

    Why the parent directory file is kept in the current directory?

  4. #4
    Join Date
    Sep 2010
    Beans
    898

    Re: command problem

    ".." is a link to the parent directory. The command "cd .." navigates from the current directory to its parent.

  5. #5
    Join Date
    Dec 2011
    Beans
    46

    Re: command problem

    No,
    It is now shown as a link.
    It is still shown as a directory by the ls command.
    WHY?

  6. #6
    Join Date
    Apr 2010
    Location
    England
    Beans
    3,286

    Re: command problem

    What?

    . and .. are directories. What do you mean ".." is shown as a link?
    http://xkcd.com/293/
    There are 10 kinds of people in this world: Those who understand ternary, those who don't, and those who confuse it with binary.

  7. #7
    Join Date
    Nov 2010
    Location
    India
    Beans
    Hidden!

    Re: command problem

    Dont miss anything even it is small. one small pin is enough to bring down a man.


  8. #8
    Join Date
    Dec 2011
    Beans
    46

    Re: command problem

    Why the current directory contains a parent directory?

  9. #9
    Join Date
    Apr 2010
    Location
    England
    Beans
    3,286

    Re: command problem

    Because if it didn't, how would you navigate? You'd only be able to go one way through the filing system.
    http://xkcd.com/293/
    There are 10 kinds of people in this world: Those who understand ternary, those who don't, and those who confuse it with binary.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •