what is the command to list files in a directory in UNIX?

Answer Posted / siva

Try this command

ls -lrt | grep "^-" - for list the only files
ls -lrt | grep "^d" - for list the only directory's

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can you see the command line history?

804


Which command will print your home directory on screen?

773


What is awk used for?

817


What is ctrl d?

786


How do I run a whois command?

809






Why is awk called awk?

764


Is there any method to erase all files in the current directory, along with its all sub-directories, by using only one command?

804


Enlist some filename manipulation commands in unix.

739


What is awk good for?

787


How do I use grep to find a file?

801


What are the dos commands?

854


Which command can you use to find the currently running process in unix server?

769


How is the command '$cat file2 ' different from '$cat >file2 and >> redirection operators ?

960


What is the use of tee command?

749


What does the command '$ls | wc –l > file1' do?

886