List files in subdirectories recursively in Linux
The command used to list directory content in Linux is ls. With the -R option, ls will traverse the directory recursively, showing the content of the particular directory and all its subdirectories. Relative directory path is displayed before the directory content is actually listed.
The following is an example of the command in use;
$ ls -R testdir/ testdir/: subdir1 subdir2 testdir/subdir1: subsubdir1 subsubdir2 testdir/subdir1/subsubdir1: file1 testdir/subdir1/subsubdir2: file2 testdir/subdir2: subsubdir1 subsubdir2 testdir/subdir2/subsubdir1: file3 testdir/subdir2/subsubdir2: file4
Posted on 17.12.2008 and categorized under linux