Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 348
  • Last Modified:

how can i list file in ther directory

How can I list file in directory and subdirectory

0
teera
Asked:
teera
7 Solutions
 
ppfoongCommented:

ls
ls -l
ls -al

normally, an alias called "dir" is also predefined. "dir" is the DOS command for the same purpose.

0
 
ppfoongCommented:

If you want to list BOTH the directory and all subdirectories under it, use:

find



0
 
sunnycoderCommented:
Hi teera,

ls -r

-r is recursive option and would list all entries in the subdirectories too.

-A option would suppress the implied . and .. entries in each directory ...

-1 option can be used to display one entry per line

ls -Ar /path/to/top/dir

Another option is to use find

find /path/to/top/dir -type f

Note that this will display only the files and not the names of the sub-directories

Cheers!
sunnycoder
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
arvindCommented:
cd dir

ls -ar *

0
 
akumanovaCommented:
if the ls command doesn't work, you can use the echo coomand within the shell to list the files in a directory.  For example, echo *.
0
 
marxyCommented:
To list recurcivelly use

ls -lR
0
 
Mohan ShivaiahCommented:
To list file in directory and subdirectory and also you can see the size of the file using
the command
du -k /path_to_the_folder.

mohan shivaiah
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now