file name in folder

here is the few commond i am doing:

$ ls -l
total 6
drwxrwxr-x   2 dv1gfp   dv1gfp      1024 Oct 12 09:57 archive
-rw-r--r--   1 odv1gfp  oradba      1805 Oct 12 09:56 Schroders.CSV
$ ls -lrt * | awk '{print $9}'|grep -v "^d"
Schroders.CSV



test.dat
SANJIT4.dat
CITI5.dat
ANAND6.dat
ANA8.dat
ANA7.dat
3.dat
2.dat
export.CSV_1
export.CSV
export.csv.orig
$

now i want to know the file name in this folder, but giving this command listing out all files within archive folder also.
Can anyone help me out, which command should I release for this.

What do you want? Do you want to show file but not directory?
If yes, try this

for file in `ls -lrt * | awk '{print $9}'|grep -v "^d"`
do
    if [ -f $file ]; then
       echo $file
   fi
loop

ls -lrt | grep -v "^d" | awk '{print $9}'

remove * from ls command and shift grep one step ahead... because if you put awk first, it takes only the 9 th column ( i.e file name )... then no where you can find "^d" to remove lines.

hi

$ ls -lrt | grep -v "^d" | awk '{print $9}'

Sanjit.CSV

Why there is one blank line coming here

where as line

$ ls -lrt *.CSV | awk '{print $9}'|grep -v "^d"
sanjit.CSV

no blank line coming

Just try... the following two commands

ls -lrt *.CSV
ls -lrt

In the second command you will find additional line something like "total 6"... this is causing the blank line...

if you want to filter this out, add

change the grep to

egrep -v "^d|^total"

#!/bin/sh

find -type f | while IFS= read vo
do
echo `basename "$vo"`
done