Listing Directory Recursively

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ashokd001
    New Member
    • Aug 2008
    • 30

    Listing Directory Recursively

    Hi

    I want list all files on all directory recursively.As example below,

    /home/ashok>ls -1p
    test.txt
    test1.txt
    directory1/
    directory2/

    /home/ashok> cd directory1/
    ashok/directory1>ls -1p
    a1.txt
    a2.txt

    ashok/directory1>cd ../directory2/
    ashok/directory2>ls -1p
    b1.txt
    b2.txt


    The above is the directory structure from home directory.
    I want to display like this below from /home/ashok>
    listing:::

    test.txt
    test1.txt
    directory1/a1.txt
    directory1/a2.txt
    directory2/b1.txt
    directory2/b2.txt

    How do i do that.

    Thanks in advance.Any suggestion is highly appriciated.

    -Ashok
  • ashitpro
    Recognized Expert Contributor
    • Aug 2007
    • 542

    #2
    try with 'find' command

    find . -print

    NOTE:There is dot after find command....

    Comment

    • ashokd001
      New Member
      • Aug 2008
      • 30

      #3
      It is exactely what i am expecting but the first entry is giving "."
      I want all files under current and all child directories not any directory entry in the listing.But the first entry is a directory "."

      Can you please suggest how do i remove the first entry.

      -Ashok

      Comment

      • ashitpro
        Recognized Expert Contributor
        • Aug 2007
        • 542

        #4
        Originally posted by ashokd001
        It is exactely what i am expecting but the first entry is giving "."
        I want all files under current and all child directories not any directory entry in the listing.But the first entry is a directory "."

        Can you please suggest how do i remove the first entry.

        -Ashok
        Try this command..It will give you the list of files only...
        all directory entries will be excluded..
        find . -type f -print

        Comment

        • ashokd001
          New Member
          • Aug 2008
          • 30

          #5
          Really great....
          Thanks a lot..
          -Ashok

          Comment

          Working...